[llvm-branch-commits] [clang] [llvm] Continuation of fexec-charset (PR #169803)

Sergei Barannikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 4 12:49:11 PDT 2026


================
@@ -120,13 +125,17 @@ static PrintfSpecifierResult ParsePrintfSpecifier(FormatStringHandler &H,
     return true;
   }
 
-  if (*I == '{') {
+  if (FormatStrConverter.convert(*I) == '{') {
     ++I;
     unsigned char PrivacyFlags = 0;
     StringRef MatchedStr;
 
     do {
-      StringRef Str(I, E - I);
+      const char *II;
+      std::string S(I, E - I);
+      for (unsigned long i = 0; i < S.length(); ++i)
+        S[i] = FormatStrConverter.convert(S[i]);
+      StringRef Str(S);
       std::string Match = "^[[:space:]]*"
----------------
s-barannikov wrote:

I wish we could guard the whole block by Objective-C check rather than do the conversion here. AFAIK `os_log`/`__builtin_os_log_format` that take this path only support UTF-8 encoded strings. Although I know little about Objective-C and may be wrong.

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


More information about the llvm-branch-commits mailing list