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

William Tran-Viet via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 24 09:49: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
----------------
smallp-o-p wrote:

I would think a user who is building libc++ without localization wouldn't have much use for a text encoding database, hence guarding it behind `_LIBCPP_HAS_LOCALIZATION`, however I'm not an expert. In the standard, localization and text_encoding are different subcategories of the text processing library, so it's more likely that the guard should be removed. Perhaps @cor3ntin could weigh in?

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


More information about the libcxx-commits mailing list