Handle cut-off UTF-8 sequences when reading files

Read additional bytes from the file to complete the UTF-8 sequence so the bytes
in it don't get converted to U+FFFD replacement characters.
This commit is contained in:
William Langford committed 2017-01-27 21:04:26 -05:00
1 parent fd4ae8304e
commit e84d17196c
7 files changed
+54 -5

No files matched your search

+1
View File
@@ -1,6 +1,7 @@
#ifndef JV_UNICODE_H
#define JV_UNICODE_H
const char* jvp_utf8_backtrack(const char* start, const char* min, int *missing_bytes);
const char* jvp_utf8_next(const char* in, const char* end, int* codepoint);
int jvp_utf8_is_valid(const char* in, const char* end);