You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parsing XML file with Unicode characters causes problem #47992
It complains of a UnicodeEncodeError
'charmap' codec can't encode character '\xc8' in position 45: ch
aracter maps to <undefined>
I included a sample program, just in case I was doing something wrong
while coding.
Python 3.0b2 (r30b2:65106, Jul 18 2008, 18:44:17) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
The encoding used by the windows terminal (usually cp850) is not able to
encode all the characters, so when you print the text that you extract
from the xml file the terminal is not able able to display some
characters. If you remove the print() it works fine. You can also try to
write the results on a file using utf-8.
Activity
jaylogan commentedon Aug 31, 2008
Python 3.0b2 will not parse the XML file located at
http://rubyquiz.com/SongLibrary.xml.gz
It complains of a UnicodeEncodeError
'charmap' codec can't encode character '\xc8' in position 45: ch
aracter maps to <undefined>
I included a sample program, just in case I was doing something wrong
while coding.
Python 3.0b2 (r30b2:65106, Jul 18 2008, 18:44:17) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
ezio-melotti commentedon Feb 20, 2009
The encoding used by the windows terminal (usually cp850) is not able to
encode all the characters, so when you print the text that you extract
from the xml file the terminal is not able able to display some
characters. If you remove the print() it works fine. You can also try to
write the results on a file using utf-8.
This issue can be closed.