Home > Back-end >  Questions about the C language to read the file encoding
Questions about the C language to read the file encoding

Time:09-24

https://blog.csdn.net/weixin_44023015/article/details/105851195
Is simply like a default is ANSI code, after reading the file made reading in Chinese into the code, specific content I wrote a blog before, think bosses, please help to solve this problem confused me for a long time

CodePudding user response:

You read fread is binary, in when opening the file will be "r" to "rb" and "w" to "wb" give it a try

CodePudding user response:

I've tried, is still the same

CodePudding user response:

Char to would be

CodePudding user response:


TXT a two byte header tags is unicode.
The ANSI/utf8 didn't,

CodePudding user response:

reference 4 floor smwhotjay response:

TXT a two byte header tags is unicode.
ANSI/utf8,

Utf8 BOM optional, 0 xef, 0 XBB, 0 XBF
  • Related