[Catalyst] Special characters and MySQL issue

Matt S Trout dbix-class at trout.me.uk
Mon Aug 28 15:30:51 CEST 2006


Tobias Kremer wrote:
> 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? :) ]

Have a prod at DBIx::Class::UTF8Columns, which will do the trick if you do switch.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list