[Catalyst] Special characters and MySQL issue

Tobias Kremer t at funkreich.de
Mon Aug 28 10:12:38 CEST 2006


Hey Jon,

> What happens if you 'use encoding "iso-8859-1"' at the top of the script
> that accepts this data?

Unfortunately that didn't help. Maybe because iso-8859-1 is the
default encoding anyways?

> BTW my suggestion is to not send latin-1 to the browser.  Use the
> "Encode" module to convert from latin-1 bytes to perl characters, and
> then use the C::P::Unicode module to send UTF-8 to the browser.

Why not use ISO-8859-1 everywhere? What's wrong with that approach?
Every sane browser should work perfectly with it.

I suppose the best place to do what you're suggesting is in the model - and it
should be in one place shared by all model classes so that I'll be able
to switch to UTF-8 database encoding within seconds. Any suggestions on
where to best put this - maybe by overriding some methods in the schema
class? I'm using DBIx::Class [ ... what else? :) ]

Is this really the proposed way of dealing with a legacy latin1 encoded
database and Catalyst?

Thanks for any help!

Toby



More information about the Catalyst mailing list