Corrected UTF-8 to UTF-32 conversion 11/36511/2
authorRichard Underhill <r.underhill@partner.samsung.com>
Mon, 9 Mar 2015 10:56:42 +0000 (10:56 +0000)
committerRichard Underhill <r.underhill@partner.samsung.com>
Mon, 9 Mar 2015 10:56:42 +0000 (10:56 +0000)
Change-Id: I2d6485b7cecb4e1dce451eab5f3c9a0026e93852
Signed-off-by: Richard Underhill <r.underhill@partner.samsung.com>
dali-toolkit/internal/text/character-set-conversion.cpp

index abda102..aa2721a 100644 (file)
@@ -145,7 +145,7 @@ uint32_t Utf8ToUtf32( const uint8_t* const utf8, uint32_t length, uint32_t* utf3
       case U3:
       {
         uint32_t& code = *utf32++;
-        code = leadByte & 0x1fu;
+        code = leadByte & 0x0fu;
         begin++;
         code <<= 6u;
         code |= *begin++ & 0x3fu;
@@ -157,7 +157,7 @@ uint32_t Utf8ToUtf32( const uint8_t* const utf8, uint32_t length, uint32_t* utf3
       case U4:
       {
         uint32_t& code = *utf32++;
-        code = leadByte & 0x1fu;
+        code = leadByte & 0x07u;
         begin++;
         code <<= 6u;
         code |= *begin++ & 0x3fu;