Keil BUG 导致读字库时,无法显示某些汉字解决办法

原因在于:KEIL C51 的一个汉字BUG,keil c51在编译的时候会将0xfd的字符(有些汉字含该字符的内码)过滤,


最佳解决方案:打补丁,用  晓奇工作室出的补丁 cckeilvxx.exe

http://www.pc6.com/softview/SoftView_67694.html


--------------------------------------------------------------------------------------------------------------------------------------------------------------------

下面来自网友:http://blog.sina.com.cn/s/blog_6101ed5f0101g6ee.html


1.官方解释


GENERAL: COMPILER IGNORES 0XFD, 0XFE, 0XFF VALUES IN STRINGS
Information in this article applies to:


C166 Compiler All Versions
Cx51 Compiler All Versions
C251 Compiler All Versions
QUESTION


I have a problem with the interpretation of Russian strings in the Keil C51 compiler. Some Russian characters are using the encoding 0xFD. It looks like this encoding is ignored by the compiler and is not included in the program code.


Example:


code char RussianString[] = "??? ????";
Why does this problem exist and how can I avoid this behavior?


ANSWER


The character encodings 0xFD, 0xFE, and 0xFF are used internally by the C compiler. The ANSI standard only requires support for ASCII characters in the range 0x00 - 0x7F.


You may insert these characters by using HEX encodings in the string as follows:


code char RussianString[] = "My Text" "\xFD";
A simple text replacement which replaces all 0xFD characters with the string '" "\xFD' should do the job.


即遇到无法显示字符时在其后加\xFD


如 :unsigned char code s[]="数学"; 改为 unsigned char code s[]="数\xFD学"; 即可正常显示


2.修改keil编译器


用WinHex或C32Asm等HEX编辑工具修改\C51\BIN中的C51.exe和A51.exe


十六进制搜索 80FBFD 改为 80FBFF 即可。


不过不建议使用这种方法,修改编译器后可能会产生某些意想不到的错误。

转载于:https://www.cnblogs.com/alan666/p/8312098.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值