Spanish Characters

In the beginning of the code write (in the first line):

# -- coding: 850 --

Then, you can use the characters as follows (unicode):

\xe1 = á
\xe9 = é
\xed = í
\xf3 = ó
\xfa = ú
\xc1 = Á
\xc9 = É
\xcd = Í
\xd3 = Ó
\xda = Ú
\xf1 = ñ
\xd1 = Ñ
\xbf = ¿
\xa1 = ¡

Thanks for the information. Note that code pages are legacy technology. While code pages might still work in certain circumstances, nowadays UTF-8 is the universal standard on all modern editors and most other software, too.

In Slicer we switch to “UTF-8 everywhere” in about a week - see

1 Like

This means that we can translate to Chinese more easy(such as in the Gui of a module)?

This UTF-8 development will allow usage of special characters in file names, node names, and in general, any strings that the user enters or loads from files.

You can already translate most of the GUI, but there are a few things to do:

  • use tr macro in all translatable text in the Slicer source code (should not be too much work) translation macros can find them
  • develop translation mechanism for CLI modules and Python scripted modules
  • update string definition in Python scripted modules to use the new mechanism (or .ui files)
  • re-enable language selection on GUI (was available at some point but disabled now)