mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-30 06:43:28 +01:00
Merge pull request #5505
7e5158aa
mnemonics: fix 4 byte UTF-8 rewriting (moneromooo-monero)
This commit is contained in:
commit
a22a8b0f2b
@ -129,7 +129,7 @@ namespace Language
|
|||||||
case 1: *wptr++ = cp; break;
|
case 1: *wptr++ = cp; break;
|
||||||
case 2: *wptr++ = 0xc0 | (cp >> 6); *wptr++ = 0x80 | (cp & 0x3f); break;
|
case 2: *wptr++ = 0xc0 | (cp >> 6); *wptr++ = 0x80 | (cp & 0x3f); break;
|
||||||
case 3: *wptr++ = 0xe0 | (cp >> 12); *wptr++ = 0x80 | ((cp >> 6) & 0x3f); *wptr++ = 0x80 | (cp & 0x3f); break;
|
case 3: *wptr++ = 0xe0 | (cp >> 12); *wptr++ = 0x80 | ((cp >> 6) & 0x3f); *wptr++ = 0x80 | (cp & 0x3f); break;
|
||||||
case 4: *wptr++ = 0xf0 | (cp >> 18); *wptr += 0x80 | ((cp >> 12) & 0x3f); *wptr++ = 0x80 | ((cp >> 6) & 0x3f); *wptr++ = 0x80 | (cp & 0x3f); break;
|
case 4: *wptr++ = 0xf0 | (cp >> 18); *wptr++ = 0x80 | ((cp >> 12) & 0x3f); *wptr++ = 0x80 | ((cp >> 6) & 0x3f); *wptr++ = 0x80 | (cp & 0x3f); break;
|
||||||
default: throw std::runtime_error("Invalid UTF-8");
|
default: throw std::runtime_error("Invalid UTF-8");
|
||||||
}
|
}
|
||||||
*wptr = 0;
|
*wptr = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user