std::text_encoding:: comp-name
From cppreference.net
<
cpp
|
text
|
text encoding
|
static
constexpr
bool
/*comp-name*/
(
std::
string_view
a,
std::
string_view
b
)
;
|
(C++26以降)
( 説明専用* ) |
|
2つの文字列 a と b を、通常のリテラルエンコーディングで符号化されたものとして Unicode Charset Alias Matching ルールに従って比較します。
2つの文字列は、以下の条件を満たした後に左から右へ比較した際に等しいと見なされます:
- 英数字以外のすべての文字を除去、
- すべての文字を同一のケースに変換、および
- 数値プレフィックスの直後に続かない独立した '0' 文字シーケンスを除去。数値プレフィックスは非ゼロ数字( '1' から '9' )で構成され、オプションで1つ以上の英数字以外の文字が続く。
以下は例です:
static_assert(/*comp-name*/("UTF-8", "utf8") == true); static_assert(/*comp-name*/("u.t.f-008", "utf8") == true); static_assert(/*comp-name*/("ISO-8859-1", "iso88591") == true); static_assert(/*comp-name*/("ut8", "utf8") == false); static_assert(/*comp-name*/("utf-80", "utf8") == false);
パラメータ
| a, b | - | 比較する文字列 |
戻り値
true 上記のように2つの文字列が等しいと比較された場合; false それ以外の場合。