mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 19:44:55 +00:00
Massive fmtlib refactor
This commit is contained in:
@@ -11,7 +11,7 @@ std::string WideToUTF8(std::wstring_view src) {
|
||||
utf8proc_uint8_t mb[4];
|
||||
utf8proc_ssize_t c = utf8proc_encode_char(utf8proc_int32_t(ch), mb);
|
||||
if (c < 0) {
|
||||
Log.report(logvisor::Warning, "invalid UTF-8 character while encoding");
|
||||
Log.report(logvisor::Warning, fmt("invalid UTF-8 character while encoding"));
|
||||
return retval;
|
||||
}
|
||||
retval.append(reinterpret_cast<char*>(mb), c);
|
||||
@@ -26,7 +26,7 @@ std::string Char16ToUTF8(std::u16string_view src) {
|
||||
utf8proc_uint8_t mb[4];
|
||||
utf8proc_ssize_t c = utf8proc_encode_char(utf8proc_int32_t(ch), mb);
|
||||
if (c < 0) {
|
||||
Log.report(logvisor::Warning, "invalid UTF-8 character while encoding");
|
||||
Log.report(logvisor::Warning, fmt("invalid UTF-8 character while encoding"));
|
||||
return retval;
|
||||
}
|
||||
retval.append(reinterpret_cast<char*>(mb), c);
|
||||
@@ -42,7 +42,7 @@ std::wstring UTF8ToWide(std::string_view src) {
|
||||
utf8proc_int32_t wc;
|
||||
utf8proc_ssize_t len = utf8proc_iterate(buf, -1, &wc);
|
||||
if (len < 0) {
|
||||
Log.report(logvisor::Warning, "invalid UTF-8 character while decoding");
|
||||
Log.report(logvisor::Warning, fmt("invalid UTF-8 character while decoding"));
|
||||
return retval;
|
||||
}
|
||||
buf += len;
|
||||
@@ -59,7 +59,7 @@ std::u16string UTF8ToChar16(std::string_view src) {
|
||||
utf8proc_int32_t wc;
|
||||
utf8proc_ssize_t len = utf8proc_iterate(buf, -1, &wc);
|
||||
if (len < 0) {
|
||||
Log.report(logvisor::Warning, "invalid UTF-8 character while decoding");
|
||||
Log.report(logvisor::Warning, fmt("invalid UTF-8 character while decoding"));
|
||||
return retval;
|
||||
}
|
||||
buf += len;
|
||||
|
||||
Reference in New Issue
Block a user