Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

carlosbutler

macrumors 6502a
Original poster
Feb 24, 2008
691
2
I am trying to go through a CSV file and output that in to an XML structure. I have no problem at all with the CSV or the XML, just the data - specifically non ASCII characters.

I keep getting the annoying question mark in a black diamond for latin characters such as é, ü etc

I have tried setting a locale, but this does not appear to be working (I assume because I have not done it correctly)

And help on getting that to work would be great
 

Yvan256

macrumors 603
Jul 5, 2004
5,081
998
Canada
You need to make sure your files are actually saved in the correct format. In TextWrangler, you get a small menu at the bottom to help you set the text encoding (ISO Latin 1, UTF-8, etc) and the line-ending character type (Mac, Unix, Windows, etc).

Make sure that all your files are in the correct type and if necessary check if the PHP functions that you are using are compatible with UTF-8 or whatever encoding format you are using.

If you still can't find the problem, make sure that any code that you found on the Web weren't copy-pasted directly. Sometimes there's invisible illegal characters, I can't count the number of times I've fixed errors by simply re-typing the same code of the line that gave me the error.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.