[llvm] Create a CharSetConverter class with both iconv and icu support. (PR #138893)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 07:41:49 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/Support/CharSet.h llvm/lib/Support/CharSet.cpp llvm/unittests/Support/CharSetTest.cpp llvm/unittests/Support/ConvertEBCDICTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/unittests/Support/CharSetTest.cpp b/llvm/unittests/Support/CharSetTest.cpp
index 258c7e463..77e5b3064 100644
--- a/llvm/unittests/Support/CharSetTest.cpp
+++ b/llvm/unittests/Support/CharSetTest.cpp
@@ -58,8 +58,8 @@ TEST(CharSet, FromUTF8) {
   StringRef Src(HelloA);
   SmallString<64> Dst;
 
-  ErrorOr<EncodingConverter> Conv = EncodingConverter::create(
-      TextEncoding::UTF8, TextEncoding::IBM1047);
+  ErrorOr<EncodingConverter> Conv =
+      EncodingConverter::create(TextEncoding::UTF8, TextEncoding::IBM1047);
 
   // Stop test if conversion is not supported.
   if (!Conv) {
@@ -98,8 +98,8 @@ TEST(CharSet, ToUTF8) {
   StringRef Src(HelloE);
   SmallString<64> Dst;
 
-  ErrorOr<EncodingConverter> Conv = EncodingConverter::create(
-      TextEncoding::IBM1047, TextEncoding::UTF8);
+  ErrorOr<EncodingConverter> Conv =
+      EncodingConverter::create(TextEncoding::IBM1047, TextEncoding::UTF8);
 
   // Stop test if conversion is not supported.
   if (!Conv) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/138893


More information about the llvm-commits mailing list