[Melbourne-pm] UTF-8 headaches

Toby Corkindale toby.corkindale at rea-group.com
Wed Nov 14 17:06:45 PST 2007

Kat Grant wrote:
> Hi All
> We have a web front ended application, and (not unusually) some jobs  
> that run server side in the background.
> My problem is that the same bit of code called from within the web  
> server handles utf8 characters in just fine, but when called from a  
> standalone script, turns them into rubbish.
> The code is literally identical, and it's doing my head in.
> I've tried running with all the various possible values of -C but  
> nothing has helped.
> The code is pulling some UTF-8 data from a mysql database,  
> constructing a MIME::Lite message and sending it. The messages come  
> through fine when sent from within the webserver, but the characters  
> are trashed when sent from a stand alone script.
> We use perl 5.8.8, MySQL 5, Apache 1.3, mod_perl on debian.
> Can anyone suggest anything?

Check $ENV{LOCALE} and related environment flags under web server's env
and your shell env?

Also - assert that the strings /are/ utf8 encoded, just in case they're
not and it just happens that the webserver is managing to
detect-and-correct the bytestreams somehow?


> Cheers
> K
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm

Toby Corkindale
Software developer

More information about the Melbourne-pm mailing list