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

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sun May 25 09:04:17 PDT 2025


================
@@ -0,0 +1,1482 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_H
+#define _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if _LIBCPP_HAS_LOCALIZATION
----------------
philnik777 wrote:

If it's only one or two functions that actually require locale we should guard only those. It may not make a ton of sense to use this without localization, but `_LIBCPP_HAS_LOCALIZATION` really means "has libc locale support". Unless there is actually a platform requirement for a feature, we shouldn't guard that feature.

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


More information about the libcxx-commits mailing list