Delphi出现 No mapping for the Unicode character exists in the target multi-byte code page 处理方法


本文整理自网络,侵删。

 
当调用 TStrings.LoadFromFile(html_file_name, TEncoding.UTF8); 出现 No mapping for the Unicode character exists in the target multi-byte code page错误。

这种错误在调用非UTF8编码的文件时会出错。

处理方法如下

    tmpStrs.LoadFromFile(html_file_name, TEncoding.UTF8);  //先用utf-8尝试
    except      //出现 No mapping for the Unicode character exists in the target multi-byte code page
      tmpStrs.LoadFromFile(html_file_name);   //再用默认编码尝试
    end;
――――――――――――――――

原文链接:https://blog.csdn.net/webouse/article/details/54599217

相关阅读 >>

Delphi文本文件的写操作

Delphi中带缓存的数据更新技术

Delphi嵌入循环汇编

Delphi 编写的一个感染文件夹的小病毒

Delphi high 返回数组下标的最大值

Delphi实现使用tidhttp控件向https地址post请求

Delphi检查是否在64位windows环境中运行?

Delphi查找同一内网所有主机

Delphi内嵌汇编语言basm精要

Delphi中操作powerpoint幻灯片的示例代码

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...