[PATCH] D106753: ConvertUTF: Created wrapper convertUTF32ToUTF8String

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 25 10:02:25 PDT 2021


efriedma added a comment.

Please fix clang-format issues.  (You can use the clang-format-diff.py script.)



================
Comment at: llvm/lib/Support/ConvertUTFWrapper.cpp:154
+  // Error out on an uneven byte count.
+  if (SrcBytes.size() % 2)
+    return false;
----------------
Wrong constant.


================
Comment at: llvm/lib/Support/ConvertUTFWrapper.cpp:168
+  std::vector<UTF32> ByteSwapped;
+  if (Src[0] == UNI_UTF16_BYTE_ORDER_MARK_SWAPPED) {
+    ByteSwapped.insert(ByteSwapped.end(), Src, SrcEnd);
----------------
Wrong constant.

Is this really the function you want to be using from clang?  I don't really understand why you'd want to handle byte order marks.


================
Comment at: llvm/lib/Support/ConvertUTFWrapper.cpp:203
+{
+  return convertUTF16ToUTF8String(
+      llvm::ArrayRef<char>(reinterpret_cast<const char *>(Src.data()),
----------------
Wrong function?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106753/new/

https://reviews.llvm.org/D106753



More information about the cfe-commits mailing list