- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
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