[OSM-dev] Restrict key names on order to retain reusability of OSM

Martijn van Oosterhout kleptog at gmail.com
Tue Feb 12 08:15:45 GMT 2008


On Feb 12, 2008 2:23 AM, Frederik Ramm <frederik at remote.org> wrote:
> BTW, does having UTF8 keys mean that a key may contain a null byte, or
> is UTF8 crafted in a way to avoid that?

It's specially crafted so that:
- A NUL byte can't appear in any valid charater
- No character is a substring of any other character
- Leading bytes are distinguished from following bytes (for quick scanning)

Which pretty much means all the functions of the C library work on
utf-8 strings, even if you don't know they're utf-8. Not many
encodings have that property.

FWIW, if we're going to forbid anything in keys, I'd say forbid just
the space, that will discourage people from putting values in it, but
I don't feel strongly about it.

Have a nice day,
-- 
Martijn van Oosterhout <kleptog at gmail.com> http://svana.org/kleptog/




More information about the dev mailing list