<p></p>
<p dir="auto">In <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="369612253" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/2025" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/2025/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/2025">#2025</a> 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.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mmd-osm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mmd-osm">@mmd-osm</a> points out that the function <a href="https://github.com/zerebubuth/openstreetmap-cgimap/blob/master/include/cgimap/util.hpp#L21-L35"><code class="notranslate">unicode_strlen</code> in openstreetmap-cgimap</a> 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 <code class="notranslate">unicode_strlen</code> relies on <code class="notranslate">std::mbsrtowcs</code>, which will give a length that is dependent on the type of <code class="notranslate">wchar_t</code>. My understanding is that <code class="notranslate">wchar_t</code> 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.</p>
<p dir="auto">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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3706">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLZTJXK2HNWMPH3HTLV7IM3VANCNFSM6AAAAAAQRNU3SQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLKCSHMRYEEN45NOEO3V7IM3VA5CNFSM6AAAAAAQRNU3SSWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFEQDW7Y.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/3706</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/3706",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3706",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>