And how does it do that (if it does actually work)?
In general, explicit encoding/decoding only makes sense when either:
a) you're given a unicode string but need a byte string
b) you're given a byte string but need a unicode string
c) you're given a byte string in one encodingbut need a byte string in
a different encoding.
Taking a byte string, converting it to unicode using the locale's
default encoding, then converting it back to a byte string using the
same encoding achieves nothing (but creates additional possibilities
for failure in the event that the selected encoding is incorrect).
> > What problem is it trying to fix?
>
> it fixes issue on Windows when user name contains non-ascii charecters
> (which is quite common on this platform).
>
> > And how does it do that (if it does actually work)?
>
> I have created on my Windows machine such user and this patch was
> necessary otherwise GRASS start script simply fails.
How/why does it fail? And how does this change fix that?
In the absence of any useful information, r58200 has been reverted for
lib/init/grass.py (the change to lib/python/script/core.py remains).
On Fri, Nov 15, 2013 at 10:21 AM, Glynn Clements
<glynn@gclements.plus.com>wrote:
Glynn Clements wrote:
> > > What problem is it trying to fix?
> >
> > it fixes issue on Windows when user name contains non-ascii charecters
> > (which is quite common on this platform).
> >
> > > And how does it do that (if it does actually work)?
> >
> > I have created on my Windows machine such user and this patch was
> > necessary otherwise GRASS start script simply fails.
>
> How/why does it fail? And how does this change fix that?
In the absence of any useful information, r58200 has been reverted for
lib/init/grass.py (the change to lib/python/script/core.py remains).
I cannot test this because I'm not able to create user with non-ascii
chars at my ms win machine, either because of domain issues or locale or
both.
On Fri, Nov 15, 2013 at 10:50 AM, Vaclav Petras <wenzeslaus@gmail.com>wrote:
On Fri, Nov 15, 2013 at 10:21 AM, Glynn Clements <glynn@gclements.plus.com
> wrote:
Glynn Clements wrote:
> > > What problem is it trying to fix?
> >
> > it fixes issue on Windows when user name contains non-ascii charecters
> > (which is quite common on this platform).
> >
> > > And how does it do that (if it does actually work)?
> >
> > I have created on my Windows machine such user and this patch was
> > necessary otherwise GRASS start script simply fails.
>
> How/why does it fail? And how does this change fix that?
In the absence of any useful information, r58200 has been reverted for
lib/init/grass.py (the change to lib/python/script/core.py remains).
I cannot test this because I'm not able to create user with non-ascii
chars at my ms win machine, either because of domain issues or locale or
both.
Finally, I was able to create a user with non-ascii chars. I tried r58198
(before Martin's change) and GRASS runs, opens location, saves last open
location to user settings and loads them afterwards. So, r58200 is not
needed for that machine.
However, I was not able to create a location in my home directory. I cannot
test the other directories.
The test was done in US locale, I don't know how this would behave in some
non-ascii locale. I would guess that this can make difference. I've noticed
that in the command line, the user name was converted to ascii.
Other problem was that I got a "Select application to open .py file" dialog
once (this was reported in #2015). The nice thing about it is that it does
not happen on other user accounts on the same machine.
Finally, I was able to create a user with non-ascii chars. I tried r58198
(before Martin's change) and GRASS runs, opens location, saves last open
location to user settings and loads them afterwards. So, r58200 is not
needed for that machine.
I can confirm it, strangely when I was producing the patch I was
forced to do also changes in grass.py which were later reverted. So
the change in `core.py` seems to be enough to fix this bug (non-ascii
characters in user name). Please could anyone else confirm it?