I always forget, can't remember. Googling kills lots of time. This blog is only for myself, but if you get any help from this, it will be a bonus for me.
Monday, October 19, 2009
Writing Unicode file in Python
Just use the following code to write an Unicode text in a file by Python.
out = file("Unicode-File.txt", "w" ) out.write(codecs.BOM_UTF8) s = "any Unicode text" out.write( s.encode( "utf-8" ) )
No comments:
Post a Comment