'length' function now measures string length in codepoints, not bytes.

This commit is contained in:
Stephen Dolan committed 2013-05-15 00:37:38 +01:00
1 parent c496a924ce
commit e83e51eb56
9 files changed
+29 -17

No files matched your search

+1 -1
View File
@@ -93,7 +93,7 @@ struct lexer_param;
(\\[^u(]|\\u[a-zA-Z0-9]{0,4})+ {
/* pass escapes to the json parser */
jv escapes = jv_string_fmt("\"%.*s\"", yyleng, yytext);
yylval->literal = jv_parse_sized(jv_string_value(escapes), jv_string_length(jv_copy(escapes)));
yylval->literal = jv_parse_sized(jv_string_value(escapes), jv_string_length_bytes(jv_copy(escapes)));
jv_free(escapes);
return QQSTRING_TEXT;
}