When one paste into console content like: "中" or some funny emoticons like: "👨👩👧", the output in the console is broken:
Problem is at this line:
|
return k->uChar.UnicodeChar; |
If the char is a high surrogate, you keep it, read the lower surrogate and combine these before returning... something like this:
if (wc >= 0xD800 && wc <= 0xDBFF) {
surrogate_high = wc;
continue; // keep reading a key
}
if (wc >= 0xDC00 && wc <= 0xDFFF) {
if (surrogate_high == 0) continue; // orphan low - discard
req->key.uchar = 0x10000
+ (((REBU32)(surrogate_high - 0xD800)) << 10) + ((REBU32)(wc - 0xDC00));
surrogate_high = 0;
}
else {
req->key.uchar = wc; // normal Unicode char
}
When one paste into console content like: "中" or some funny emoticons like: "👨👩👧", the output in the console is broken:
Problem is at this line:
arturo/src/extras/linenoise/linenoise-win32.c
Line 354 in 1ba74c6
If the char is a high surrogate, you keep it, read the lower surrogate and combine these before returning... something like this: