From e5965c6b5c877dd648ccf7a1c9461accdb87a2bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=93=86=E5=95=A6D=E5=A4=A2=7CDuolaD?= <110040721+DuolaD@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:05:25 +0800 Subject: [PATCH] Used from V1.9.0 DEV RC1(except V2.01.0)(Put it on mod root directory) --- InjectResource/convert_encoding-Old.bat | 62 +++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 InjectResource/convert_encoding-Old.bat diff --git a/InjectResource/convert_encoding-Old.bat b/InjectResource/convert_encoding-Old.bat new file mode 100644 index 0000000..33757f9 --- /dev/null +++ b/InjectResource/convert_encoding-Old.bat @@ -0,0 +1,62 @@ +::Powered and Note By Github@DuolaD +::code1=ANSI(GB2312) +::code2=Big5 +::code3=Shift_JIS +::code4=EUC-KR +::code5=UTF-8 +::code6=Unicode + +@echo off & setlocal enabledelayedexpansion +title HoYoShade Encoding Converter(Powered By DuolaD X AXBro) +echo Do not close this Window!This program well close it very Soon! +echo 不要关闭此窗口!这个程序很快就会关闭! +echo 不要關閉此視窗!這個程式很快就會關閉! + +::Set the encoding type before file conversion, please refer to the Note above +set aaa=1 + +::Set the encoding type after file conversion, please refer to the Note above +set bbb=5 + +::set file=%~nx1 + +::You can Change 'Reshade.ini' to any '.txt' file if you want to use it to another place or just want modded HoYoShade By Yourself. +set file=ReShade.ini + +::You don't need to modify the following code + +set wfiles=%file% +echo !aaa!|findstr /be "[1-6]" >nul ||goto :eof +echo !bbb!|findstr /be "[1-6]" >nul ||goto :eof + +if "!aaa!" == "!bbb!" goto :eof +echo>MakeBOM.vbs Set objFSO = CreateObject("Scripting.FileSystemObject") +echo>> MakeBOM.vbs Set objFile = objFSO.CreateTextFile("Unicode.BOM",,true) +cscript //Nologo MakeBOM.vbs +set codepth=AfterConvert +md %codepth%\tmp + +:loop +set vvv=!aaa! + +if "!aaa!" == "6" set vvv=!bbb! +for /f "tokens=%vvv%" %%a in ("936 950 932 949 65001") do (reg add "HKCU\Console\%%SystemRoot%%_System32_cmd.exe" /v CodePage /t REG_DWORD /d %%a /f >nul) +if not "!aaa!" == "6" ( +if not "!bbb!" == "6" ( +start /wait /min cmd /u /c "for %%a in (%%wfiles%%) do copy Unicode.BOM tmpfile.tmp&type "%%~fa" >> tmpfile.tmp&move /y tmpfile.tmp %codepth%\tmp\"%%~nxa"" +set aaa=6 +set wfiles=%codepth%\tmp\* +goto loop +) + +) +if "!bbb!" == "6" ( +start /wait /min cmd /u /c "for %%a in (%%wfiles%%) do copy Unicode.BOM tmpfile.tmp&type "%%~fa" >> tmpfile.tmp&move /y tmpfile.tmp %codepth%\"%%~nxa"" +) else (start /wait /min cmd /c "for %%a in (%%wfiles%%) do type "%%~fa" > %codepth%\"%%~nxa"") +reg delete "HKCU\Console\%%SystemRoot%%_System32_cmd.exe" /v CodePage /f >nul +del MakeBOM.vbs +del Unicode.BOM +move /y "%codepth%\%file%" "%file%" +rd /s /q "%codepth%" + +exit \ No newline at end of file