The culprit seems to be r52517 which includes the following line in
lib/init.grass.py:
{{{
language = language.split('.')[0] # Split off ignored .encoding part if
present
}}}
Why should the encoding part be split off, especially since it is _not_
ignored as implied by the comment. Module messages that have been
translated (in my case into French) and include special characters are not
displayed correctly.
When I comment out this line, I get messages in the correct encoding.
Maris, could you explain the reason for taking away the encoding info ?
I'm tempted to comment out the line for now and see if anyone reports
negative consequences, but I'll wait a few days to see if there is a
reason for it.
#2021: encoding information in locale gets lost
--------------------------+-----------------------------
Reporter: mlennert | Owner: grass-dev@…
Type: defect | Status: reopened
Priority: normal | Milestone: 7.0.1
Component: Startup | Version: svn-trunk
Resolution: | Keywords: locale encoding
CPU: Unspecified | Platform: Linux
--------------------------+-----------------------------
Comment (by marisn):
Replying to [comment:3 mlennert]:
> Reopening this, as with a fairly fresh trunk (r65364), I get:
Please provide locale line from GRASS wx configuration file.
set_language() kicks in only if a language override is requested within
wxgui settings.
#2021: encoding information in locale gets lost
--------------------------+-----------------------------
Reporter: mlennert | Owner: grass-dev@…
Type: defect | Status: reopened
Priority: normal | Milestone: 7.0.1
Component: Startup | Version: svn-trunk
Resolution: | Keywords: locale encoding
CPU: Unspecified | Platform: Linux
--------------------------+-----------------------------
Comment (by mlennert):
Replying to [comment:4 marisn]:
> Replying to [comment:3 mlennert]:
> > Reopening this, as with a fairly fresh trunk (r65364), I get:
> Please provide locale line from GRASS wx configuration file.
>
> set_language() kicks in only if a language override is requested within
wxgui settings.
Yep, that was it. There was an override in the wx config file.
However, this is quite confusing as I was not even using the wxgui. I
don't think wxgui config should interfere with command line.
#2021: encoding information in locale gets lost
--------------------------+-----------------------------
Reporter: mlennert | Owner: grass-dev@…
Type: defect | Status: reopened
Priority: normal | Milestone: 7.0.1
Component: Startup | Version: svn-trunk
Resolution: | Keywords: locale encoding
CPU: Unspecified | Platform: Linux
--------------------------+-----------------------------
Comment (by marisn):
Hm. Probably set_language should be moved to some place to kick-in only if
a GUI session is started.
Rant:
The architectural problem lies in the fact that GRASS is not a monolithic
app as i.e. QGIS. GUI's can be started from CLI and there are CLI apps too
(and, of course, "native" widgets like "open file"!). Thus setting a
language in wxgui tries to cover all potential aspects to ensure a
constant user experience.
The problem areas are: lack of target locale on particular system (only
GRASS messages will be translated); incorrect default encoding (i.e. for
Latvian language Python is certain that Win-1257 is the best thing on my
UTF-8 Linux box and then hell breaks loose!); enforcing language on
everything (cal; "OK" and "Cancel" buttons; all GRASS module output as it
might be piped back to GUI; did I forgot something?
As one can see - it is easy to mess something up and "quick fixes" need to
ensure covering most of aspects as it is too easy to make things worse.
(just check my own commits for language switching and you will see that it
is true )