[Catalyst] uri_for and unicode

Bernhard Graf catalyst4 at augensalat.de
Tue Mar 9 14:05:24 GMT 2010

Am 09.03.2010 14:30, schrieb Alex Povolotsky:

> After adding Catalyst::Plugin::Unicode::Encoding, it became MUCH worse.
> What was readable, became unreadable. What was unreadable, remained so.
> Replacing C::P::Unicode by C::P::Unicode::Encoding did not yield any
> difference.

Then you are probably doing it wrong!

I suspect that you want to use cyrillic characters. The problem is, that
most software components (also Perl) default to latin1 or similar.

A good start is always to use utf-8 encoding everywhere: your source
code, your web pages encoding and your database charset.


  use utf8;

in your Perl file!
(unless you are absolutely sure, you are not using any non-ASCII chars)

Explicitly set your databases encoding to utf-8 on connect (see the
appropriate DBD::*/DBIC manpages how to do that) and don't use

Tip for MySQL: To check that your data isn't accidently double-encoded,
you might want to use length(). This function returns the number of
bytes, so e.g. if a field contains the string 'süß', length(field)
returns 5 (because ü and ß are encoded in 2 bytes in utf-8). If it is
not 5, your data encoding is borked.



More information about the Catalyst mailing list