diff options
Diffstat (limited to 'lutf8lib.c')
-rw-r--r-- | lutf8lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -47,7 +47,7 @@ static lua_Integer u_posrelat (lua_Integer pos, size_t len) { | |||
47 | ** Decode one UTF-8 sequence, returning NULL if byte sequence is | 47 | ** Decode one UTF-8 sequence, returning NULL if byte sequence is |
48 | ** invalid. The array 'limits' stores the minimum value for each | 48 | ** invalid. The array 'limits' stores the minimum value for each |
49 | ** sequence length, to check for overlong representations. Its first | 49 | ** sequence length, to check for overlong representations. Its first |
50 | ** entry forces an error for non-ascii bytes with no continuation | 50 | ** entry forces an error for non-ASCII bytes with no continuation |
51 | ** bytes (count == 0). | 51 | ** bytes (count == 0). |
52 | */ | 52 | */ |
53 | static const char *utf8_decode (const char *s, l_uint32 *val, int strict) { | 53 | static const char *utf8_decode (const char *s, l_uint32 *val, int strict) { |
@@ -55,7 +55,7 @@ static const char *utf8_decode (const char *s, l_uint32 *val, int strict) { | |||
55 | {~(l_uint32)0, 0x80, 0x800, 0x10000u, 0x200000u, 0x4000000u}; | 55 | {~(l_uint32)0, 0x80, 0x800, 0x10000u, 0x200000u, 0x4000000u}; |
56 | unsigned int c = (unsigned char)s[0]; | 56 | unsigned int c = (unsigned char)s[0]; |
57 | l_uint32 res = 0; /* final result */ | 57 | l_uint32 res = 0; /* final result */ |
58 | if (c < 0x80) /* ascii? */ | 58 | if (c < 0x80) /* ASCII? */ |
59 | res = c; | 59 | res = c; |
60 | else { | 60 | else { |
61 | int count = 0; /* to count number of continuation bytes */ | 61 | int count = 0; /* to count number of continuation bytes */ |