[libcxx-commits] [PATCH] D126971: [libc++] Implements Unicode grapheme clustering

Victor Zverovich via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 10 09:00:19 PDT 2022


vitaut added inline comments.


================
Comment at: libcxx/test/std/utilities/format/format.functions/ascii.pass.cpp:31
+  //*** 2-byte code points ***
+  assert(std::format("{:*^4}", "\u00a1") == "*\u00a1*"); // INVERTED EXCLAMATION MARK
+  assert(std::format("{:*^4}", "\u07ff") == "*\u07ff*"); // NKO TAMAN SIGN
----------------
Mordante wrote:
> vitaut wrote:
> > I think the output should be "*\u00a1**" because U+00A1 has an estimated width of 1: http://eel.is/c++draft/format#string.std-11.
> This test tests the output when using ASCII. When using ASCII the codepoint uses two bytes and thus `*\u00a1*` is correct. In the Unicode test the column width is estimated at one. I left a comment in that file.
Missed that, sorry. It makes sense now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126971



More information about the libcxx-commits mailing list