StringIO + unicode

Laszlo Nagy gandalf at shopzeus.com
Tue Mar 25 05:26:04 EDT 2008


Is there a standard "in-memory file" interface for reading/writting 
unicode stings? Something like StringIO.

E.g. this would be possible:

- create UnicodeStringIO
- write unicode strings into it
- wite data (binary) string of UnicodeStringIO into a file ('wb' mode)

and then later:

- read the same file with codecs.open(filename,"r",encoding="utf-8")

Maybe there is no standard class for this and I have to implement it 
myself. (?)

Thanks,

   Laszlo






More information about the Python-list mailing list