[GRASS-dev] g.message and unicode in python
glynn at gclements.plus.com
Sat Nov 22 15:31:55 PST 2014
Vaclav Petras wrote:
> > So, it's bad idea even trying to do this (and thinking that everyone is
> > going to read it)? Best practice to avoid such situations alltogether and
> > respect the cross-platform principle?
Or you can use localised strings with _("..."), using only ASCII in
the string literal but using locale-specific characters in the message
> It seems safer to me to print unicode characters using Python only and not
> use g.message because for g.message you have to pass the characters to
> another command.
It doesn't matter. g.message will just pass the bytes to G_message()
which will (more or less) just send them to stderr.
So long as the string doesn't contain null bytes and the space, tab,
and newline characters have the same meansing as in ASCII, there isn't
any difference between sending the bytes directly to stderr or sending
them via g.message.
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev