当调用 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;