[Dancer-users] Using utf-8 data from database and template toolkit

Christian Sánchez sanchezchristian at gmail.com
Sun Apr 4 04:11:08 UTC 2010


Hi, I'm using Dancer to make a little application that uses a
DBIx::Class scheme of another app written in Catalyst. I want to reuse
some templates I've made for that Catalyst app, it works fine, but I
have some data in my DB with words like 'Sánchez', 'José', etc, when I
show this data in the template it shows something like "S�nchez".
I put in my config.yml this:

engines:
    template_toolkit:
        start_tag: '[%'
        stop_tag: '%]'
        encoding: 'utf-8'

I try with "encoding" and "ENCODING" in the same way I use it in catalyst.

I'm using in the DBIx::Class schema: "UTF8Columns"  and :

__PACKAGE__->utf8_columns(qw/ciudad nombres apellidos comentarios/);

Im using postgresql originally in the Catalyst app, but for this app I
want to use sqlite3 for just a couple of this tables, I tried this for
both postgresql and sqlite3 but didn't work.

Also I put: "use utf8" in my app.pm file. And in main.tt:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

What do you recommend for this? maybe I missing something, I've read
the docs but I didn't found something for this.

BTW, I like Dancer, great job guys!

Regards

-- 
Christian Sánchez
Usuario GNU/Linux 234800
Maracay - Venezuela
http://g013m.com.ve


More information about the Dancer-users mailing list