How to use UTF-8 in C code?

后端 未结 5 907
耶瑟儿~
耶瑟儿~ 2021-02-04 03:06

My setup: gcc-4.9.2, UTF-8 environment.

The following C-program works in ASCII, but does not in UTF-8.

Create input file:

echo -n \'привет мир\'          


        
5条回答
  •  不知归路
    2021-02-04 03:41

    Probably your test.c file is not stored in UTF-8 format and for that reason "привет мир" string is ASCII - and the comparison failed. Change text encoding of source file and try again.

提交回复
热议问题