Printing unicode to file

Steven Cummings stevenc at engineer.com
Tue Oct 23 16:12:33 EDT 2001


I know this has been covered a little before on this newsgroup, but I 
think my problem is a little different than was solved before. I'm 
retrieving text from Word (which is apparently unicode through COM) and 
I'm writing out the information to html files. I can't do an 
encode('utf-16') or nothing shows up right (I get a big chunk of chinese 
characters). If I encode('utf-8') on the way out to file, it may work, 
but it's hard to tell because for some reason it takes up to three 
minutes just to do the encode (?!?). And I'm not so sure if all of the 
characters will get translated correctly. What is the best way to go 
about this, altering text from MSWord through COM and generally writing 
it out to some text format?

/S




More information about the Python-list mailing list