zoukankan      html  css  js  c++  java
  • 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编辑工具修改C51BIN中的C51.exe和A51.exe


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


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

  • 相关阅读:
    知识点整理
    NGINX 内存池有感
    NGINX怎样处理惊群的
    NGINX 定时器
    制作linux内核安装包
    ES6变量的解构赋值
    jquery uploadify上传插件用法心得
    【转贴】J2EE中的13种技术规范
    【转帖】Servlet 3.0 新特性详解
    汉诺塔问题的一个C#实现
  • 原文地址:https://www.cnblogs.com/alan666/p/8312098.html
Copyright © 2011-2022 走看看