[3PP] Uplift utfcpp

This commit is contained in:
Adrian 2025-02-01 19:51:40 +00:00
parent 4cc074df63
commit 877acb5613
5 changed files with 10 additions and 10 deletions

2
.gitmodules vendored
View File

@ -42,7 +42,7 @@
url = https://github.com/libsdl-org/SDL.git
[submodule "third_party/utfcpp"]
path = third_party/utfcpp
url = https://github.com/xenia-project/utfcpp.git
url = https://github.com/nemtrif/utfcpp.git
[submodule "third_party/fmt"]
path = third_party/fmt
url = https://github.com/fmtlib/fmt.git

View File

@ -9,7 +9,7 @@
#include "xenia/base/cvar.h"
#include <iostream>
#define UTF_CPP_CPLUSPLUS 201703L
#define UTF_CPP_CPLUSPLUS 202002L
#include "third_party/utfcpp/source/utf8.h"
#include "xenia/base/console.h"
@ -125,9 +125,9 @@ std::string EscapeBasicString(const std::string_view view) {
result += "\\\\";
} else if (c < 0x20 || c == 0x7F) {
if (c <= 0xFFFF) {
result += fmt::format("\\u{:04X}", c);
result += fmt::format("\\u{:04X}", static_cast<uint32_t>(c));
} else {
result += fmt::format("\\u{:08X}", c);
result += fmt::format("\\u{:08X}", static_cast<uint32_t>(c));
}
} else {
utfcpp::append(static_cast<char32_t>(c), result);
@ -159,7 +159,7 @@ std::string EscapeMultilineBasicString(const std::string_view view) {
if (c == '\b') {
result += "\\b";
} else if (c == '\t' || c == '\n') {
result += c;
result += static_cast<uint32_t>(c);
} else if (c == '\f') {
result += "\\f";
} else if (c == '\r') {
@ -171,9 +171,9 @@ std::string EscapeMultilineBasicString(const std::string_view view) {
result += "\\\\";
} else if (c < 0x20 || c == 0x7F) {
if (c <= 0xFFFF) {
result += fmt::format("\\u{:04X}", c);
result += fmt::format("\\u{:04X}", static_cast<uint32_t>(c));
} else {
result += fmt::format("\\u{:08X}", c);
result += fmt::format("\\u{:08X}", static_cast<uint32_t>(c));
}
} else {
utfcpp::append(static_cast<char32_t>(c), result);

View File

@ -22,7 +22,7 @@
#include <strings.h>
#endif // !XE_PLATFORM_WIN32
#define UTF_CPP_CPLUSPLUS 201703L
#define UTF_CPP_CPLUSPLUS 202002L
#include "third_party/utfcpp/source/utf8.h"
namespace utfcpp = utf8;

View File

@ -15,7 +15,7 @@
#include <numeric>
#include <tuple>
#define UTF_CPP_CPLUSPLUS 201703L
#define UTF_CPP_CPLUSPLUS 202002L
#include "third_party/utfcpp/source/utf8.h"
namespace utfcpp = utf8;

2
third_party/utfcpp vendored

@ -1 +1 @@
Subproject commit f295c4b9a1f4db635164ab4defc3938049152a3c
Subproject commit 65701fe00700577f9f4e9b96d682bd7cfcc0b76e