Martin Landa wrote:

> > Author: glynn
> > Date: 2011-05-21 06:51:24 -0700 (Sat, 21 May 2011)
> > New Revision: 46343
> >
> > Modified:
> >   grass/trunk/lib/python/core.py
> > Log:
> > Don't try to decode process output
> 
> can you elaborate a bit? Thanks in advance.

The output from and input to GRASS commands consists of bytes, not
characters.

Decoding (and subsequent re-encoding) creates a risk of (pointless)
conversion failures if commands produce output which isn't compatible
with the locale's encoding (which is quite possible; with a few
exceptions, GRASS libraries and modules deal with bytes, not
characters).

If wxGUI wants (unicode) character strings, wxGUI should perform the
decoding. In general, if the data is being passed to wxWidgets, it
should be decoded. If it's being passed to a command or written to a
file, the raw byte sequences should normally be passed through
untouched.

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to