c++ - how to tell if a wchar_t has a surrogate (UTF-16)? -


i've seen few other posts on issue unable find details on how determine programatically if codepoint uses more 1 2-byte (on windows) wchar_t.

an example:

const wchar_t* s2 = l"\u0002008a"; // "han" character std::wstring in(s2);               // length() == 2 

i'd know how determine when character have length() > 1.

any codepoint above u+ffff uses surrogates in utf-16 encoding. surrogate values in range d800-dfff.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -