NYCPHP Meetup

[nycphp-talk] fgetcsv and German characters

Stephen Musgrave stephen at capellic.com
Tue Aug 14 13:03:02 EDT 2007


> Locale wouldn't matter in this case; that's primarily useful when
> generating content (such as formatted dates or gettext translations).

That's odd, because they have examples in the comments in the  
documentation on php.net that it does.  However, my experience is in  
line with your statement.  ;-)

> You need to figure out what encoding was used on the original csv
> document, and then use iconv functions or similar to convert it to
> utf-8 or whatever encoding is being used by your system for storage
> and display.
>
> How to do that? I would open the csv file in a web browser and play
> with the character encodings until it looked right--View>Character
> Encoding in Firefox--but there might be a more systematic way...

I am not on Windows, so Office documents don't open in my browser.   
Any other suggestions?



More information about the talk mailing list