refactor: refactor testbench for UTF8 string. fix refactor bug
This commit is contained in:
1 parent
ccb729c718
commit
e5b6e8c6c3
3 files changed
+98
-101
No files matched your search
@@ -81,7 +81,7 @@ namespace YYCC::ParserHelper {
|
||||
num
|
||||
);
|
||||
if (ec == std::errc()) {
|
||||
return yycc_u8string(buffer.data(), ptr - buffer.data());
|
||||
return yycc_u8string(buffer.data(), EncodingHelper::ToUTF8(ptr) - buffer.data());
|
||||
} else if (ec == std::errc::value_too_large) {
|
||||
// too short buffer
|
||||
// this should not happend
|
||||
|
||||
Reference in new issue
Block a user