Show a warning message if ventoy.json is in UCS-2 encoding. (#1125)

ventoy.json must in UTF-8 encoding. The BOM is auto skipped if exist.
This commit is contained in:
longpanda
2021-11-08 14:55:08 +08:00
parent 32602a79ab
commit a9c539572b
2 changed files with 30 additions and 5 deletions

View File

@@ -2178,12 +2178,19 @@ fi
if [ -n "$VTOY_PLUGIN_SYNTAX_ERROR" ]; then
clear
echo -e "\n Syntax error detected in ventoy.json, please check! \n"
echo -e " ventoy.json 文件中有语法错误,所有配置都不会生效,请检查!\n"
if [ -n "$VTOY_PLUGIN_ENCODE_ERROR" ]; then
echo -e "\n Encoding type for ventoy.json is not supported, please convert to UTF-8.\n"
echo -e " ventoy.json 文件编码格式不支持,请转换为 UTF-8 编码格式!\n"
else
echo -e "\n Syntax error detected in ventoy.json, please check! \n"
echo -e " ventoy.json 文件中有语法错误,所有配置都不会生效,请检查!\n"
fi
echo -e "\n press ENTER to continue (请按 回车 键继续) ..."
read vtInputKey
read vtInputKey
fi
for vtTFile in ventoy.json ventoy_grub.cfg; do
if [ -f $vtoy_efi_part/ventoy/$vtTFile ]; then
clear