Page 1 of 1

解决字幕乱码

Posted: 15 Apr 2015, 07:57
by arcticir

Code: Select all

P:="F:\Memento.2000.Bluray.1080p.DTS-HD.x264-Grym.cht.srt"
FileRead,s,% "*P950 " P
FileDelete, % P
FileAppend , % s, % P ,UTF-8

Re: 解决字幕乱码

Posted: 15 Apr 2015, 09:31
by tmplinshi

Code: Select all

srtFile := "F:\Memento.2000.Bluray.1080p.DTS-HD.x264-Grym.cht.srt"
reEncoding(srtFile, "CP950", "UTF-8") ; CP950 = 繁体

reEncoding(File, fromEncoding, toEncoding) {
	data := FileOpen(File, "r", fromEncoding).Read()
	FileOpen(File, "w", toEncoding).Write(data)
}