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

Alex Strelnikov via libc-commits libc-commits at lists.llvm.org
Wed Jun 24 11:51:55 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 += ',';
+  }
----------------
strel-12 wrote:

Thanks for the pointer to `StringConverter`. Although it is a template type, it looks like underlying `CharacterConverter` only has overloads to push UTF-8 and UTF-32 [lines in character_converter.h](https://github.com/llvm/llvm-project/blob/main/libc/src/__support/wchar/character_converter.h#L61-L62). 

Please correct me if I'm mistaken, but my understanding is adding a fully correct `wchar_t` path is not trivial enough to pack into this PR, at least for the Windows encoding. What are you thoughts?

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


More information about the libc-commits mailing list