[nycphp-talk] fgetcsv and German characters
stephen at capellic.com
Wed Aug 15 09:13:16 EDT 2007
Thanks for your suggestions. We ran out of time on addressing this
issue (technically), so we decided to "Romanize" (boooo!) the
input. I know, I do feel like a defeatist, but it's not my
budget! I did not use mb_detect_encoding, but that sounds like
something that would help.
And the chant goes up: UTF-8! UTF-8! UTF-8!
On Aug 14, 2007, at 4:59 PM, Rob Marscher wrote:
> On Aug 14, 2007, at 10:01 AM, Stephen Musgrave wrote:
>> Oh, how I love character encoding problems! ;-)
> Indeed... there's so many levels where they can get messed up --
> the way the text was originally encoded, anything that php might do
> to it, the database column character encoding, the database client
> connection encoding, anything php might do to it again, the way
> apache serves it, the encoding specified in the html, and finally
> the browser character encoding setting.
>> 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.
> Maybe you should publicly post a stripped down file that
> demonstrates the problem so that we can pull it down and take a look.
> If you create your own csv with those characters (vs. the ones your
> user(s) have uploaded), can you reproduce the problem? [tip... on
> osx, press option-u and then u to create ü and option-u and then a
> to create ä]
> Do you have the mbstring extension? If so, what does running the
> text through mb_detect_encoding <http://us2.php.net/manual/en/
> function.mb-detect-encoding.php> give you?
> When can we all agree that the extra disk space needed for every
> app to use utf8 is worth it? :)
> New York PHP Community Talk Mailing List
> NYPHPCon 2006 Presentations Online
> Show Your Participation in New York PHP
More information about the talk