Skip to content

Commit

Permalink
Merge pull request #307 from s-yasu/fix-utf8-decode
Browse files Browse the repository at this point in the history
Fix UTF-8 decode for 4bytes rune
  • Loading branch information
skvadrik committed Sep 14, 2020
2 parents ee125da + 30130a7 commit 90e5a23
Show file tree
Hide file tree
Showing 3 changed files with 305 additions and 114 deletions.
4 changes: 2 additions & 2 deletions src/encoding/utf8/utf8.cc
Expand Up @@ -8,8 +8,8 @@ const uint32_t utf8::ERROR = 0xFFFDu;
const utf8::rune utf8::MAX_1BYTE_RUNE = 0x7Fu;
const utf8::rune utf8::MAX_2BYTE_RUNE = 0x7FFu;
const utf8::rune utf8::MAX_3BYTE_RUNE = 0xFFFFu;
const utf8::rune utf8::MAX_4BYTE_RUNE = 0x10FFFFu;
const utf8::rune utf8::MAX_RUNE = utf8::MAX_4BYTE_RUNE;
const utf8::rune utf8::MAX_4BYTE_RUNE = 0x1FFFFFu;
const utf8::rune utf8::MAX_RUNE = 0x10FFFFu;

const uint32_t utf8::PREFIX_1BYTE = 0u; // 0000 0000
const uint32_t utf8::INFIX = 0x80u; // 1000 0000
Expand Down

0 comments on commit 90e5a23

Please sign in to comment.