在CStdio文件中存在疑问 [英] Doubt in CStdio File
本文介绍了在CStdio文件中存在疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
i在CStdio文件中有疑问我在文件中有文字即
REPTVW_PRJ_ID_BID_REPORT_OPEN_IN_WORD =在Word™中打开
正在阅读每一个精美的预期™
它的播种就像REPTVW_PRJ_ID_BID_REPORT_OPEN_IN_WORD = 在Word中打开
商标未读取文件
可能是什么问题请告诉我
解决方案
我测试了它,并且Unicode构建只有一个问题。
原因是ReadString
使用fgetws
调用mbtowc
使用当前语言环境进行字符转换。当您的程序未设置语言环境时,它默认为仅支持ASCII的C语言环境。所以你必须在程序启动时设置一次语言环境:
setlocale(LC_ALL,English);
见还有MSDN setlocale [ ^ ]页。
要将语言环境设置为Windows实际使用的ANSI代码页,请使用:
setlocale(LC_ALL,。ACP);
Hi all,
i have doubt in CStdio File i have text in file i.e
REPTVW_PRJ_ID_BID_REPORT_OPEN_IN_WORD="Open in Word™"
its reading everyhting fine expect ™
its raeding like REPTVW_PRJ_ID_BID_REPORT_OPEN_IN_WORD="Open in Word"
trade mark is not reading from the file
what might be the problem please let me know
解决方案
I have tested it and there is only a problem with Unicode builds.
The reason is thatReadString
usesfgetws
which callsmbtowc
which uses the current locale for character conversion. When the locale is not set by your program it defaults to the C locale which only supports ASCII. So you must set the locale once upon program start:
setlocale(LC_ALL, "English");
See also the MSDN setlocale[^] page.
[EDIT]
To set the locale to the ANSI code page actually used by Windows use:
setlocale(LC_ALL, ".ACP");
这篇关于在CStdio文件中存在疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文