[Tutor] UTF-8 by default

Jonas Melian jonasmg at softhome.net
Sun May 29 10:00:26 CEST 2005


Kent Johnson wrote:
>>How write by default in UTF-8 instead of ASCII?
> 
> 
> How are you writing the file? What encoding is your data originally?
> 

For writing the XML file:
>>ElementTree.ElementTree(root).write("file.xml")

The source encoding is UTF-8 ( # -*- coding: utf-8 -*- )


But I also want that the program shows its messages in differents
languages, so it's necessary writting (>>>print 'Message') in UTF-8 by
default


More information about the Tutor mailing list