当前位置:网站首页>Open Chinese path file in C language

Open Chinese path file in C language

2022-06-12 14:54:00 Diligent brother Cheng

How to use C Language open Windows Download the Chinese path file ?

Although the principle is not clear , But I did find a way today .

1. Write first C Language program , There is the logic of the file with Chinese path you want to open ,fopen The path you want to open is directly used in the string of the function . At this time, the source file is generally UTF-8 Coded .

2. Then save the source file as ANSI Coded file .

3. Then compile the saved file ( Do not use IDE Reopen the saved source file , Otherwise the code will change back ), And then run exe The file can successfully open the path of the Chinese code .

But if you open a file other than ANSI code , So if you try to write Chinese in it , It will cause the contents of the original file to be garbled , And the Chinese you write will not be garbled .

原网站

版权声明
本文为[Diligent brother Cheng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206121447129578.html