std::text_encoding:: text_encoding
From cppreference.net
<
cpp
|
text
|
text encoding
|
constexpr
text_encoding
(
)
=
default
;
|
(1) | (C++26부터) |
|
constexpr
explicit
text_encoding
(
std::
string_view
enc
)
noexcept
;
|
(2) | (C++26부터) |
|
constexpr
text_encoding
(
std
::
text_encoding
::
id
i
)
noexcept
;
|
(3) | (C++26부터) |
새로운 텍스트 인코딩 객체를 생성합니다.
만약
enc
가
등록된 문자 인코딩
중
NATS-DANO
또는
NATS-DANO-ADD
가 아닌 것을 지정하면, 생성된 객체는 해당하는
MIBenum
값을 가지며, 그렇지 않으면 MIBenum
std
::
text_encoding
::
id
::
other
값을 가집니다.
동작은 다음의 경우 정의되지 않습니다:
enc.
size
(
)
>
std
::
text_encoding
::
max_name_length
||
enc.
contains
(
'
\0
'
)
.
만약
i
가
std
::
text_encoding
::
id
::
other
이거나
std
::
text_encoding
::
id
::
unknown
라면, 생성된 객체는 빈
문자 인코딩 이름
을 가지며, 그렇지 않으면
해당 이름들 중 하나
를 가집니다.
매개변수
| enc | - | 문자 인코딩 이름 |
| i | - | MIBenum 값 |
예제
다음에서 보기: Compiler Explorer .
이 코드 실행
#include <text_encoding> int main() { constexpr std::text_encoding iso60 = std::text_encoding::ISO60DanishNorwegian; static_assert(iso60 == std::text_encoding("csISO60DanishNorwegian")); static_assert(iso60 == std::text_encoding("iso-ir-60")); static_assert(iso60 == std::text_encoding("NS_4551-1")); }
외부 링크
| 문자 집합 이름 및 MIBenum 값의 IANA 레지스트리 . |