From f3eeaa66099c6c1727b4041c331827f3bfea36c7 Mon Sep 17 00:00:00 2001 From: Yiheng Wu <36156959+jingkaimori@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:40:57 +0800 Subject: [PATCH] fix fmt parsing error on windows (#2481) * fix fmt parsing error on windows * introduce changes as patch * Update xmake.lua --------- Co-authored-by: ruki --- packages/f/fmt/patches/10.1.0/utf8.patch | 13 +++++++++++++ packages/f/fmt/xmake.lua | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 packages/f/fmt/patches/10.1.0/utf8.patch diff --git a/packages/f/fmt/patches/10.1.0/utf8.patch b/packages/f/fmt/patches/10.1.0/utf8.patch new file mode 100644 index 000000000..c415bd924 --- /dev/null +++ b/packages/f/fmt/patches/10.1.0/utf8.patch @@ -0,0 +1,13 @@ +diff --git a/include/fmt/format.h b/include/fmt/format.h +index e5bd8b1..1a05db3 100644 +--- a/include/fmt/format.h ++++ b/include/fmt/format.h +@@ -1453,7 +1453,7 @@ template class to_utf8 { + ++p; + if (p == s.end() || (c & 0xfc00) != 0xd800 || (*p & 0xfc00) != 0xdc00) { + if (policy == to_utf8_error_policy::abort) return false; +- buf.append(string_view("�")); ++ buf.append(string_view("\xEF\xBF\xBD")); + --p; + } else { + c = (c << 10) + static_cast(*p) - 0x35fdc00; diff --git a/packages/f/fmt/xmake.lua b/packages/f/fmt/xmake.lua index 7d5d9981c..80cc0f860 100644 --- a/packages/f/fmt/xmake.lua +++ b/packages/f/fmt/xmake.lua @@ -17,6 +17,10 @@ package("fmt") add_versions("6.0.0", "b4a16b38fa171f15dbfb958b02da9bbef2c482debadf64ac81ec61b5ac422440") add_versions("5.3.0", "4c0741e10183f75d7d6f730b8708a99b329b2f942dad5a9da3385ab92bb4a15c") + add_patches("10.1.0", + path.join(os.scriptdir(), "patches", "10.1.0", "utf8.patch" ), + "3280569bced9ec08933f0ea37b6a4fef4538944d9046fe197ad63e22d1357cd4") + add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"}) if is_plat("mingw") and is_subhost("msys") then