[llvm] [llvm-strings] Add --encoding={s,S,utf8} option (PR #221794)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 01:46:41 PDT 2026


================
@@ -0,0 +1,28 @@
+## Show that llvm-strings uses the specified encoding.
+
+RUN: echo a > %t
+RUN: echo ab >> %t
+RUN: echo abc >> %t
+RUN: echo abcd >> %t
+RUN: echo abcd€ >> %t
+
+# Check that long form options work.
+RUN: llvm-strings --encoding s 2>&1 %t | FileCheck --check-prefixes CHECK,CHECK-ASCII %s
+RUN: llvm-strings --encoding S 2>&1 %t | FileCheck                                    %s
----------------
jh7370 wrote:

Okay, that's fair, but it probably needs a comment indicating that this is why the Euro isn't being checked for.

That being said, I think there is a test coverage hole in that we don't have anything that shows that Euro is printed anyway: if I'm not mistaken, if you added CHECK-LOCALE to the `s` test case, you'd still get a passing test regardless of locale!

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


More information about the llvm-commits mailing list