Forum Archive

Using 'foreign characters' in Scene

upwart

I am trying to display 'foreign characters', like accented é and à in a Scene via Text, but that results in coercing to unicode errr. How can handle this properly?

dgelessus

First of all, make sure that at the top of the file is a comment saying # -*- coding: utf-8 -*-. Although it's only a comment, this is important for Python to know what text encoding the program uses. Then you should add the letter u before any string with foreign characters to make it a unicode object instead of normal str. (For example u"üñîçødé" instead of "üñîçødé".)

upwart

@dgelessus
That's it. Thanks.