From cbed08fec9c6d62f8fa4fc13a71102c799d96640 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Wed, 28 Nov 2012 19:07:39 +0800 Subject: [PATCH] Kernel - Fixed stupid bug in utf-8 code (mirrored in userland) --- KernelLand/Kernel/lib.c | 2 +- Usermode/Applications/axwin3_src/WM/utf-8.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.20.1