[libcxx-commits] [libcxx] [llvm] [libc++] Implement P1885R12: `<text_encoding>` (PR #141312)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 8 14:04:31 PDT 2026


================
@@ -107,6 +109,12 @@ public:
     return std::use_facet<std::collate<_CharT> >(*this).compare(
                __x.data(), __x.data() + __x.size(), __y.data(), __y.data() + __y.size()) < 0;
   }
+#  if _LIBCPP_STD_VER >= 26
+  _LIBCPP_AVAILABILITY_TE_ENVIRONMENT _LIBCPP_HIDE_FROM_ABI std::text_encoding encoding() const {
+    std::string __name = name();
+    return __get_locale_encoding(__name.c_str());
----------------
ldionne wrote:

```suggestion
    return std::__get_locale_encoding(__name.c_str());
```

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


More information about the libcxx-commits mailing list