[libc-commits] [libc] [libc] Change cpp::string_view into cpp::basic_string_view<CharT> (PR #203355)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Wed Jun 24 10:56:58 PDT 2026


================
@@ -70,6 +70,19 @@ cpp::enable_if_t<cpp::is_fixed_point_v<T>, cpp::string> describeValue(T Value) {
 cpp::string_view describeValue(const cpp::string &Value) { return Value; }
 cpp::string_view describeValue(cpp::string_view Value) { return Value; }
 
+cpp::string describeValue(cpp::wstring_view Value) {
+  cpp::string S;
+  S += '{';
+  for (const wchar_t *Iter = Value.begin(); Iter + 1 != Value.end(); ++Iter) {
+    S += cpp::to_string(*Iter);
+    S += ',';
+  }
----------------
michaelrj-google wrote:

I would prefer to use the wchar string converter so that the output is displayed as UTF-8. That can be found in `libc/src/__support/wchar/string_converter.h`.

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


More information about the libc-commits mailing list