On Aug 01, 2006, at 20:09 UTC, Mathieu Langlois wrote: > You have just experienced encoding hell. Try something like text = > text.convertencoding(encodings.macroman) before outputting to the file > (assuming you're working on a mac, on windows replace macroman by > windowslatin1). > > The reason is because RB defaults to UTF8 so you need to explicitly > convert it to the OS native encoding before writing it, although if > you opened your text file in a smarter editor, like Word, it would > most probably output fine.
To further clarify: the data in the file looks wrong because whatever you're using to view the data in the file isn't smart enough to interpret it properly. If you opened it in TextEdit or TextWrangler, it would probably look fine (unless you've explicitly told it to guess an older encoding). I generally wouldn't recommend using an older encoding like MacRoman or WindowsLatin1, unless you are sure you need to. Unicode is both the present and the future, and UTF-8 is cross-platform portable to boot. Consider whether you can leave your data in UTF-8, and just get a better method of viewing it. Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>