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

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Sat Nov 15 21:56:39 PST 2025


================
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+// REQUIRES: locale.en_US.UTF-8
+// UNSUPPORTED: no-localization
+
+// class locale
+
+// text_encoding encoding() const
+
+// Concerns:
+// 1. Default locale returns a text_encoding representing "ASCII"
+// 2. Locale built with en_US.UTF-8 returns text_encoding representing "UTF-8"
+
+#include <cassert>
+#include <locale>
+#include <text_encoding>
+
+#include "test_macros.h"
+#include "platform_support.h"
+
+using id = std::text_encoding::id;
+
+int main(int, char**) {
+#if false
----------------
H-G-Hristov wrote:

??

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


More information about the libcxx-commits mailing list