Skip to content

Commit 8542c17

Browse files
authored
Apply suggestions from code review
1 parent 2d01cda commit 8542c17

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/unicode.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,8 +2851,7 @@ int main() {
28512851
#elif __unix__
28522852
// 反正 Unix 系统默认都是 UTF-8,不设置也行,这里设置全局 locale 是为了让 iswspace 接受全角空格、iswpunct 接受全角逗号 L',' 等
28532853
//setlocale(LC_ALL, "zh_CN.utf-8"); // 设置使用中文本地化,可使 strerror 输出中文(但用户必须 locale-gen 过中文!)
2854-
//setlocale(LC_ALL, "C.utf-8"); // 设置使用语言中性 locale,只影响 iswspace、iswpunct 等函数,不会使 strerror 等输出中文
2855-
setlocale(LC_ALL, ""); // 若使用空字符串(推荐),则默认使用当前系统环境变量中的语言 $LANG,使 strerror 自动适应
2854+
setlocale(LC_ALL, "C.utf-8"); // 设置使用语言中性 locale(推荐),只影响 iswspace、iswpunct 等函数,不会使 strerror 等输出中文
28562855
#endif
28572856
// 这里开始写你的主程序吧!
28582857
// ...

0 commit comments

Comments
 (0)