From: John Hodge (sonata) Date: Wed, 28 Nov 2012 11:07:39 +0000 (+0800) Subject: Kernel - Fixed stupid bug in utf-8 code (mirrored in userland) X-Git-Tag: rel0.15~639 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=cbed08fec9c6d62f8fa4fc13a71102c799d96640;p=tpg%2Facess2.git Kernel - Fixed stupid bug in utf-8 code (mirrored in userland) --- diff --git a/KernelLand/Kernel/lib.c b/KernelLand/Kernel/lib.c index 5f302d4f..d0c6de6d 100644 --- a/KernelLand/Kernel/lib.c +++ b/KernelLand/Kernel/lib.c @@ -180,7 +180,7 @@ int ReadUTF8(const Uint8 *str, Uint32 *Val) } // Four Byte - if( (*str & 0xF1) == 0xF0 ) { + if( (*str & 0xF8) == 0xF0 ) { outval = (*str & 0x07) << 18; // Upper 3 Bits str ++; if( (*str & 0xC0) != 0x80) return 2; // Validity check diff --git a/Usermode/Applications/axwin3_src/WM/utf-8.c b/Usermode/Applications/axwin3_src/WM/utf-8.c index 5c088281..93e0318b 100644 --- a/Usermode/Applications/axwin3_src/WM/utf-8.c +++ b/Usermode/Applications/axwin3_src/WM/utf-8.c @@ -52,7 +52,7 @@ int ReadUTF8(const char *Input, uint32_t *Val) } // Four Byte - if( (*str & 0xF1) == 0xF0 ) { + if( (*str & 0xF8) == 0xF0 ) { *Val = (*str & 0x07) << 18; // Upper 3 Bits str ++; if( (*str & 0xC0) != 0x80) return -1; // Validity check