[libcxx-commits] [PATCH] D150031: [libc++][format] Adds a UTF transcoder.

Tom Honermann via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 23 13:44:51 PDT 2023


tahonermann requested changes to this revision.
tahonermann added a comment.
This revision now requires changes to proceed.

Sorry for the delay, again. I think this is looking good. I noticed one issue that I think needs to be addressed and otherwise just want to confirm that lack of support for encoding UTF-8 is intentional for now.



================
Comment at: libcxx/include/print:39-43
+// The names of these concepts are modelled after P2728R0, but the
+// implementation is not. char16_t may contain 32-bits so depending on the
+// number of bits is an issue.
+template <class _Tp>
+concept __utf8_code_unit = same_as<_Tp, char8_t> || same_as<_Tp, char>;
----------------
As far as I can tell, the `__utf8_code_unit` concept is not used, nor is there a UTF-8 overload of `__encode()`. That is ok if intentional, I'm just mentioning it in case it isn't.

The use of `char8_t` should be predicated on `_LIBCPP_HAS_NO_CHAR8_T` not being defined since `char8_t` support can be disabled with `-fno-char8_t`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150031/new/

https://reviews.llvm.org/D150031



More information about the libcxx-commits mailing list