Skip to content

Commit c26556b

Browse files
committed
Fix and speed up en/decoding of UTF-8 strings
* src/coding.c (get_char_bytes, encode_string_utf_8) (decode_string_utf_8): Fix commentary. (encode_string_utf_8): Return the original ASCII string only if NOCOPY is non-zero. (decode_string_utf_8): Accept 2 additional arguments STR and STR_LEN, which allow to pass the input text as a C string. (make_string_from_utf8): Delegate the job to decode_string_utf_8. * src/coding.h: Update the prototype of decode_string_utf_8. * src/json.c (json_encode): Call encode_string_utf_8.
1 parent 6d4d00c commit c26556b

File tree

3 files changed

+125
-82
lines changed

3 files changed

+125
-82
lines changed

0 commit comments

Comments
 (0)