<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello<br>
I'm french and there are lot of spécial caractères in my Dancer App,<br>
<br>
é à ç etc...<br>
<br>
I use this config.yml<br>
<br>
<br>
charset: "UTF-8"<br>
<br>
template: "template_toolkit"<br>
<br>
engines:<br>
template_toolkit:<br>
encoding: 'utf8'<br>
start_tag: '[%'<br>
end_tag: '%]'<br>
<br>
<br>
....<br>
<br>
<br>
<br>
plugins:<br>
Database:<br>
connections:<br>
db:<br>
driver: 'mysql'<br>
database: 'asav'<br>
host: 'localhost'<br>
port: 3306<br>
username: 'username'<br>
password: 'password'<br>
connection_check_threshold: 10<br>
dbi_params:<br>
RaiseError: 1<br>
AutoCommit: 1<br>
mysql_enable_utf8 : 1<br>
charset: utf8<br>
log_queries: 1 <br>
<br>
<br>
all is completely transparency - I use this locale config in my
centos 6.5<br>
<br>
<br>
locale<br>
LANG=fr_FR.UTF-8<br>
LC_CTYPE="fr_FR.UTF-8"<br>
LC_NUMERIC="fr_FR.UTF-8"<br>
LC_TIME="fr_FR.UTF-8"<br>
LC_COLLATE="fr_FR.UTF-8"<br>
LC_MONETARY="fr_FR.UTF-8"<br>
LC_MESSAGES="fr_FR.UTF-8"<br>
LC_PAPER="fr_FR.UTF-8"<br>
LC_NAME="fr_FR.UTF-8"<br>
LC_ADDRESS="fr_FR.UTF-8"<br>
LC_TELEPHONE="fr_FR.UTF-8"<br>
LC_MEASUREMENT="fr_FR.UTF-8"<br>
LC_IDENTIFICATION="fr_FR.UTF-8"<br>
LC_ALL=<br>
<br>
<br>
mysql> show create database db;<br>
+----------+---------------------------------------------------------------+<br>
| Database | Create
Database |<br>
+----------+---------------------------------------------------------------+<br>
| db | CREATE DATABASE `db` /*!40100 DEFAULT CHARACTER SET utf8
*/ |<br>
+----------+---------------------------------------------------------------+<br>
1 row in set (0.00 sec)<br>
<br>
I use debug cmd to show data for debuging in console - all works
well<br>
<br>
<br>
I use redis or YAML , please do not use session JSON, there are a
bug with accents when you get data with accents stored in session.<br>
<br>
#session: 'YAML'<br>
session: 'Redis'<br>
#session: "JSON"<br>
<br>
<br>
I start with <br>
<br>
use utf8; on each lib.pm<br>
<br>
<br>
<br>
bye<br>
Hugues.<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">Le 27/06/2014 20:24, WK a écrit :<br>
</div>
<blockquote
cite="mid:CALE+RKTiSc8AWDKmUStxbo3Kb4BsES+nAnE+192m=Bea41BZvA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">2014-06-27 16:55 GMT+03:00 Warren
Young <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:warren@etr-usa.com" target="_blank">warren@etr-usa.com</a>></span>:
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
I think Dancer::Logger::Console should do that when
config.yml contains charset: "UTF-8".<br>
</blockquote>
<div><br>
</div>
<div>I agree.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
My test case boiled things down too far. My real issue
was different. It was yet another case of me thinking Perl
somehow tags strings with their source encoding, so that
data coming from a UTF-8 source and going out to a UTF-8
sink wouldn't need translation. I needed to add an
explicit encode('utf-8', $s) wrapper to that code path.<br>
</blockquote>
<div><br>
</div>
<div>I have had lot problems with UTF-8. I think, main point
which made things simpler for me: </div>
<div><br>
</div>
<div>Perl uses internally _unicode_ strings. So everything
coming in or going out needs decoding or encoding. Without
explicitly doing so, all strings are treated as being
ASCII/Latin1 encoded.</div>
<div><br>
</div>
<div>For me main problem is: in core is nothing to turn
every input/output automatically convert from/to utf-8.
Every user has to write pretty boring boilerplate to cover
all possibilities. I use utf8::all for this, but some are
criticizing it.</div>
<div><br>
</div>
</div>
-- </div>
<div class="gmail_extra">Wbr,<br>
Kõike hääd,<br>
<br>
Gunnar</div>
<div class="gmail_extra"><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
dancer-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>
<a class="moz-txt-link-freetext" href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Salutations</pre>
</body>
</html>