[GRASS-dev] Non ASCII in GISBASE, LOCATION, MAPSET, MAP

Glynn Clements glynn at gclements.plus.com
Thu Mar 25 11:57:54 EDT 2010


Radim Blazek wrote:

> can you point me to some place where restrictions for non ASCII characters use
> in GISBASE, LOCATION, MAPSET and MAP names are described?

The main restriction is G_legal_filename(), in lib/gis/legal_name.c.
This prohibits all characters >=127 and <=32 as well as the specific
characters:

	/ " ' @ , = *

[slash, double quote, single quote, at, comma, equals, asterisk.]

However, it should really be extended to also prohibit some additional
characters which aren't allowed in FAT/NTFS filenames:

	\ : ? < > |

[backslash, colon, question mark, less than, greater than, vertical bar.]

Allowing 8-bit characters runs into all sorts of problems with
encoding issues, particularly when combined with case-folding and
codepage issues on Windows (and on Windows filesystems).

As you know, vector map names are further restricted to valid SQL
identifiers. Personally, I'd like to see that restriction removed. 
There's no fundamental reason why a map's attribute table must have
*exactly* the same name as the map; an approximation (e.g. with
invalid characters replaced by underscores) would suffice, IMHO.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list