[GRASS-dev] Using non-ASCII characters in Grass.message and grass.fatal

Greetings

I would like to know if is there any way to use non-ASCII characters (e.g. à; ã; â; á, é) in grass.message and grass.fatal Python modules?
By the way, just to confirm this, it's not possible to sue *.po files to translate messages and strings in grass.message and grass.fatal (Python Scripts) right?

Thanks
Antonio

__________ Information from ESET NOD32 Antivirus, version of virus signature database 6323 (20110725) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

António Rocha wrote:

I would like to know if is there any way to use non-ASCII characters
(e.g. à; ã; â; á, é) in grass.message and grass.fatal Python modules?

The code won't care; with few exceptions, the GRASS libraries and
modules treat strings as sequences of bytes, not characters.

However, if you want the script to work correctly with different
locales, you'll need to explicitly convert to the locale's encoding,
and handle the case where such conversions aren't possible (e.g. if
the user's locale uses ASCII).

By the way, just to confirm this, it's not possible to sue *.po files to
translate messages and strings in grass.message and grass.fatal (Python
Scripts) right?

g.message doesn't translate the message. This would be problematic for
messages which aren't fixed (see my recent reply re: "g.manual
expression missing").

In Python scripts, you can use _(...) (a function whose name is a
single underscore), but there isn't a convenient solution for shell
scripts.

--
Glynn Clements <glynn@gclements.plus.com>