Unicode support

Richy2004 richard.scothern at gmail.com
Fri Aug 6 09:44:37 EDT 2004


I've experienced problems when trying to load a text file encoded with
2byte unicode characters.  No matter what combination of the following
I try, I always get an error when
executing file.readline()

file = open("file.txt", "r")
file = open("file.txt", "rb")
file = codecs.open("file.txt", "rb", "utf-16")
file = unicode(open("file.txt", "r"), "utf-16")

Even more strangely it does work when used in the interactive
interpreter.

Any ideas?

Thanks,
Richard




More information about the Python-list mailing list