<p></p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tomhughes/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tomhughes">@tomhughes</a> <a href="https://github.com/openstreetmap/openstreetmap-website/issues/2025#issuecomment-1252881853" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/2025/hovercard">said:</a></p>
<blockquote>
<p dir="auto">I mean probably it works fine given the setlocale I've just always steered clear of them myself.</p>
<p dir="auto">If it works as intended then it's counting codepoints though (which is good) not UTF16 values.</p>
</blockquote>
<p dir="auto"><code class="notranslate">setlocale</code> doesn't save you in this case, because <code class="notranslate">std:mbsrtowcs</code> behaviour depends on both the locale and the size of <code class="notranslate">wchar_t</code>. I think it is standardized in C++11 but implementation-defined before then. Outside C++11, <code class="notranslate">wchar_t</code> may be a UTF-16 code unit, whereas in C++11 I believe it will be a Unicode Scalar Value in a 4-byte native endian integer.</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#issuecomment-1252885795">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNKNPHSM5ZQRSPSTNDV7IOD3ANCNFSM6AAAAAAQRNU3SQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOBYYQNAEOQ75PD7HTV7IOD3A5CNFSM6AAAAAAQRNU3SSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSKVWCSG.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/1252885795</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#issuecomment-1252885795",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3706#issuecomment-1252885795",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>