char8_t
From cppreference.net
Null-terminated multibyte strings
| Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Wide/multibyte conversions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(C95)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Macros | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
定义于头文件
<uchar.h>
|
||
|
typedef
unsigned
char
char8_t
;
|
(C23 起) | |
char8_t 是用于 UTF-8 的无符号整数类型,与 unsigned char 类型相同。
示例
运行此代码
可能的输出:
11 UTF-8 代码单元: [ 7A C3 9F E6 B0 B4 F0 9F 8D 8C 00 ]
参考文献
- C23 标准 (ISO/IEC 9899:2024):
-
- 7.30 Unicode 工具 <uchar.h> (页码: 410)
参见
|
C++ 文档
关于
基础类型
|