Kernel - Fixed stupid bug in utf-8 code (mirrored in userland)
authorJohn Hodge (sonata) <[email protected]>
Wed, 28 Nov 2012 11:07:39 +0000 (19:07 +0800)
committerJohn Hodge (sonata) <[email protected]>
Wed, 28 Nov 2012 11:08:07 +0000 (19:08 +0800)
KernelLand/Kernel/lib.c
Usermode/Applications/axwin3_src/WM/utf-8.c

index 5f302d4..d0c6de6 100644 (file)
@@ -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
index 5c08828..93e0318 100644 (file)
@@ -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

UCC git Repository :: git.ucc.asn.au