[openstreetmap/openstreetmap-website] The specific limits on keys and values are unclear. (Issue #3706)

Aaron Muir Hamilton notifications at github.com
Tue Sep 20 20:27:38 UTC 2022


In #2025 I tried asking for what the specific limitations on key and value sizes are. These limits are often quoted as "255 characters" or "255 chars", which is ambigous. Some people interpret this as 255 UTF-16 code units, some interpret it as 255 UTF-8 bytes, some interpret it as 255 Unicode Scalar Values.

@mmd-osm points out that the function [`unicode_strlen` in openstreetmap-cgimap](https://github.com/zerebubuth/openstreetmap-cgimap/blob/master/include/cgimap/util.hpp#L21-L35) is responsible for determining the length, which is checked against 255 in order to accept or reject a key or value. This raises issues because `unicode_strlen` relies on `std::mbsrtowcs`, which will give a length that is dependent on the type of `wchar_t`. My understanding is that `wchar_t` is UTF-16LE/uint16_t on Windows, but it is implementation-dependent, and can be a 32-bit quantity instead, representing a whole Unicode Scalar Value.

I would like to have a clear understanding of what specific limits are placed on the length and content of keys and values in changeset tags.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3706
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3706 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220920/85cade3a/attachment-0001.htm>


More information about the rails-dev mailing list