Using accent characters in script name and descrip
-
On 12/01/2015 at 08:07, xxxxxxxx wrote:
Hi, I'm working on a user script in the script manager.
My script is working perfectly but at the beginning I put this :"""
Invert Vertex Map
v1.0Written for Cinema 4d R16.029
Name-US:Invert Vertex Map
Description-US:Inverts selected vertex maps
Name-ES:Invertir Mapa de Vértices
Description-ES:Invertir las mapas de vértices ya seleccionado
"""
but wherever there is an accented character (the é in vertices), it displays wrong.I looked at the general python 2.6 help but I couldn't understand how to apply the syntax to a script, rather than an imported .py file.
I couldn't work out where I should put #_*_ coding: utf-8,
or even if that was the right approach.It's not too important for this example but I would really like to be able to include European language help in my scripts without having to make a command plugin.
-
On 12/01/2015 at 14:12, xxxxxxxx wrote:
OK, after some more research, I've solved this myself.
The é was being replaced by Ã.
It's something to do with string encoding but I couldn't work out which one Cinema's Python is using or how to change it.
The solution was to use the Unicode \xe9 which is the code for é, where the \ in a string tells python to expect a special character defined with a Unicode.
Maybe there's a simpler way to do this, I'm not sure. It could get annoying if you have to write a lot of accents.