Merge commit '07fc1bb883f4c3d9b603d3a3be8c0f2dfa88c285' into main

This commit is contained in:
Sam Lantinga 2021-03-22 19:16:10 -07:00
commit 9ffd477dfc

View File

@ -537,27 +537,12 @@ SDL_UCS4ToUTF8(Uint32 ch, char *dst)
p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
p[2] = 0x80 | (Uint8) (ch & 0x3F); p[2] = 0x80 | (Uint8) (ch & 0x3F);
dst += 3; dst += 3;
} else if (ch <= 0x1FFFFF) { } else {
p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07); p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07);
p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
p[3] = 0x80 | (Uint8) (ch & 0x3F); p[3] = 0x80 | (Uint8) (ch & 0x3F);
dst += 4; dst += 4;
} else if (ch <= 0x3FFFFFF) {
p[0] = 0xF8 | (Uint8) ((ch >> 24) & 0x03);
p[1] = 0x80 | (Uint8) ((ch >> 18) & 0x3F);
p[2] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
p[3] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
p[4] = 0x80 | (Uint8) (ch & 0x3F);
dst += 5;
} else {
p[0] = 0xFC | (Uint8) ((ch >> 30) & 0x01);
p[1] = 0x80 | (Uint8) ((ch >> 24) & 0x3F);
p[2] = 0x80 | (Uint8) ((ch >> 18) & 0x3F);
p[3] = 0x80 | (Uint8) ((ch >> 12) & 0x3F);
p[4] = 0x80 | (Uint8) ((ch >> 6) & 0x3F);
p[5] = 0x80 | (Uint8) (ch & 0x3F);
dst += 6;
} }
return dst; return dst;
} }