I misinterpreted the unicode creation 'u8"\uF00xx"'.
The C++-compiler saw 'u8"\uF00x" "x"', but this was not intended.
The routine which mimicked is doing the right job now.
unsigned char rest = 0x40;
unsigned char first = 0x80;
int start = maxc-1;
- if (uchar >= (1 << 11)) {
- // needed at least 3 bytes
- c[4] = (uchar & 0x0f) | 0x30;
- uchar >>= 4;
- start = maxc-2;
- }
for (int i = start; i >=0; --i) {
if (uchar < rest) {
c[i] = first + uchar;