| Reply | « Previous Thread | Next Thread » |
|
I'm trying to write text from a TextComponent to a file, but that gives me the following error:
UnicodeError: ASCII encoding error: ordinal not in range (126) How can I solve this? |
| bercobeute |
| View Public Profile |
| Find all posts by bercobeute |
|
write:
fh.write(your_unicode_string.encode("utf-8")) read: unicode_string = fh.read().decode("utf-8") Also, check this: http://www.joelonsoftware.com/articles/Unicode.html "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)" |
| simo.salminen |
| View Public Profile |
| Find all posts by simo.salminen |
|
Thanks for the help and the excellent link! It definitely made things a lot clearer for me. Indeed a 'must read' for all software developers.
|
| bercobeute |
| View Public Profile |
| Find all posts by bercobeute |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Recording in Amr Format | losym | Symbian Media (Graphics & Sounds) | 12 | 2009-03-26 07:41 |
| RecvFrom => KErrGeneral in an endless loop | glr | Symbian Networking & Messaging | 3 | 2006-08-29 11:49 |
| GPRS + Camera => Losing Network Coverage | 3david | Python | 4 | 2005-08-23 13:46 |
| reading 5 minutes => IO.Exception | ooooooo | Mobile Java General | 9 | 2004-08-08 08:10 |