Oh, how I love character encoding problems! ;-)
I have a file upload utility whereby the user uploads a CSV
document. The file is saved to a temporary folder. I open that
document, use fgetcsv() to pull the values and then insert them into
a database.
The problem is that German characters such as ü and ä are being
translated to Ÿ and Š respectively when I echo the values to the
browser and when inserted into the DB. I wrote the values to the
error log and they come out to \x9f and \x8a respectively.
I learned that I should use the setlocale() function for German:
$loc_de = setlocale(LC_ALL, 'de_DE');
But that didn't do anything for me. I even tried as shown in the
example for setlocale() on php.net:
$loc_de = setlocale(LC_ALL, '[EMAIL PROTECTED]', 'de_DE', 'de', 'ge');
When I echo $loc_de, both say "de_DE" as expected, but it doesn't fix
my import problem.
I've checked the uploaded file contents and it looks fine.
Any suggestions would be appreciated.
Thanks,
Stephen
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php