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 createmessagedialog

Delphi android控制睡眠

Delphi 自定义消息拦截

Delphi获取硬件信息

Delphi ado 连接mssql数据库

Delphi 官方 processmessages 用法代码例子

Delphi的goto语句

Delphi 配置驱动程序(firedac)

Delphi tlistview按指定列排序

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



打赏

取消

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

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

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

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

评论

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