Skip to content

Commit 891cb53

Browse files
authored
Merge pull request #84 from CrossroadW/patch-1
Update unicode.md
2 parents c8e28b5 + 69ad7bc commit 891cb53

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

docs/unicode.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,7 @@ int main() {
14291429
// UTF-8 转 UTF-32:
14301430
std::u32string s32 = utf_to_utf<char32_t>(s8);
14311431
// UTF-32 转 UTF-16:
1432-
std::u16string s16 = utf_to_utf<char16_t>(s8);
1432+
std::u16string s16 = utf_to_utf<char16_t>(s32);
14331433
// UTF-32 转 UTF-8:
14341434
s8 = utf_to_utf<char>(s32);
14351435
std::cout << s8 << '\n';
@@ -1540,27 +1540,27 @@ int main() {
15401540
15411541
|函数名称|||
15421542
|-|-|-|
1543-
|`to_utf<char>("GBK", string)`|GBK|UTF-8|
1544-
|`to_utf<char8_t>("GBK", string)`|GBK|UTF-8|
1545-
|`to_utf<char16_t>("GBK", string)`|GBK|UTF-16|
1546-
|`to_utf<char32_t>("GBK", string)`|GBK|UTF-32|
1547-
|`to_utf<wchar_t>("GBK", string)`|GBK|Linux 上 UTF-32;Win 上 UTF-16|
1548-
|`to_utf<char>("", string)`|区域设置|UTF-8|
1549-
|`to_utf<char8_t>("", string)`|区域设置|UTF-8|
1550-
|`to_utf<char16_t>("", string)`|区域设置|UTF-16|
1551-
|`to_utf<char32_t>("", string)`|区域设置|UTF-32|
1552-
|`to_utf<wchar_t>("", string)`|区域设置|Linux 上 UTF-32;Win 上 UTF-16|
1543+
|`to_utf<char>(string, "GBK")`|GBK|UTF-8|
1544+
|`to_utf<char8_t>(string, "GBK")`|GBK|UTF-8|
1545+
|`to_utf<char16_t>(string, "GBK")`|GBK|UTF-16|
1546+
|`to_utf<char32_t>(string, "GBK")`|GBK|UTF-32|
1547+
|`to_utf<wchar_t>(string, "GBK")`|GBK|Linux 上 UTF-32;Win 上 UTF-16|
1548+
|`to_utf<char>(string, "")`|区域设置|UTF-8|
1549+
|`to_utf<char8_t>(string, "")`|区域设置|UTF-8|
1550+
|`to_utf<char16_t>(string, "")`|区域设置|UTF-16|
1551+
|`to_utf<char32_t>(string, "")`|区域设置|UTF-32|
1552+
|`to_utf<wchar_t>(string, "")`|区域设置|Linux 上 UTF-32;Win 上 UTF-16|
15531553

15541554
|函数名称|||
15551555
|-|-|-|
1556-
|`from_utf("GBK", string)`|UTF-8|GBK|
1557-
|`from_utf("GBK", u16string)`|UTF-16|GBK|
1558-
|`from_utf("GBK", u32string)`|UTF-32|GBK|
1559-
|`from_utf("GBK", wstring)`|Linux 上 UTF-32;Win 上 UTF-16|GBK|
1560-
|`from_utf("", string)`|UTF-8|区域设置|
1561-
|`from_utf("", u16string)`|UTF-16|区域设置|
1562-
|`from_utf("", u32string)`|UTF-32|区域设置|
1563-
|`from_utf("", wstring)`|Linux 上 UTF-32;Win 上 UTF-16|区域设置|
1556+
|`from_utf(string, "GBK")`|UTF-8|GBK|
1557+
|`from_utf(u16string,"GBK")`|UTF-16|GBK|
1558+
|`from_utf(u32string, "GBK")`|UTF-32|GBK|
1559+
|`from_utf(wstring, "GBK")`|Linux 上 UTF-32;Win 上 UTF-16|GBK|
1560+
|`from_utf(string, "")`|UTF-8|区域设置|
1561+
|`from_utf(u16string, "")`|UTF-16|区域设置|
1562+
|`from_utf(u32string, "")`|UTF-32|区域设置|
1563+
|`from_utf(wstring, "")`|Linux 上 UTF-32;Win 上 UTF-16|区域设置|
15641564

15651565
#### GBK 和 Shift-JIS 互转
15661566

0 commit comments

Comments
 (0)