![]() |
|
#1
|
|||
|
|||
Python Unicode problemHi!
I would like to read a file, which may or may not contain non-ascii characters such as umloats, and then output it in an ascii format. I have tried using someword.encode('ascii','replace'), but it reports Code:
Any suggestions? Thanks! |
|
#2
|
||||
|
||||
Re: Python Unicode problemAre you using the Unicode types of Python? You might want to take a look at these:
http://www.reportlab.com/i18n/python..._tutorial.html http://www.amk.ca/python/howto/unicode __________________
Common Sense v2.0-Striving to make the world a little bit smarter. |
|
#3
|
|||
|
|||
Re: Python Unicode problemI thought that `encode' WAS a function of a unicode type?
|
|
#4
|
||||
|
||||
Re: Python Unicode problemIt is. Take a look at the second link I gave. About halfway down the page it shows the encode method and gives an error example that sounds exactly like what you encountered.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter. |
|
#5
|
|||
|
|||
Re: Python Unicode problemYes, I had seen that: in fact it is EXACTLY my error. Unfortunately, I AM using 'replace' and STILL getting the same thing!
Code:
|
Recent GIDBlog
NARMY by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Neutral Python book - the Quest for the Impossible? | Kimmo | Python Forum | 1 | 04-Aug-2007 12:56 |
| Looking for opinions | crystalattice | Miscellaneous Programming Forum | 6 | 27-Sep-2006 21:02 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 20:30 |
| MAPI Unicode problem | ifulcrum | CPP / C++ Forum | 0 | 25-Jul-2005 04:39 |
| MAPI Unicode problem | ifulcrum | MS Visual C++ / MFC Forum | 0 | 25-Jul-2005 04:38 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The