[GRASS-dev] [GRASS GIS] #1293: Creating mapset with non-latin letter gives python ascii error

#1293: Creating mapset with non-latin letter gives python ascii error
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.1
Component: wxGUI | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by glynn):

Replying to [comment:14 mlennert]:

> And yes, the patch tries to prevent the GUI from calling g.mapset with
an illegal filename. But should the GUI do such checks if the module
already provides them ? Shouldn't the GUI just pass on the string
correctly and let the module handle the error ?

The GUI gets the name as a unicode string, which it needs to convert to a
byte string in order to pass it to a command as an argument. That requires
knowing the encoding, and it requires that the mapset name is actually
representable in that encoding.

The problem with allowing non-ASCII mapset names is that there may be
other people using the system and who use a different encoding. If they
use the GUI to list the mapsets in a location, the mapset name may not be
valid in the encoding they use.

Having the GUI forbid non-ASCII names up front largely eliminates the
first issue. Most of the encodings in current use are supersets of ASCII,
and the few that aren't are close enough that the differences are unlikely
to cause problems in practice (e.g. such encodings are typically unibyte
for the 7-bit range and only deviate from ASCII for less-common
punctuation characters). And the second issue means that the prohibition
on 8-bit characters is unlikely to be removed in the foreseeable future.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1293#comment:16&gt;
GRASS GIS <https://grass.osgeo.org>