问题
下载的ppt课程中的字幕在暴风影音和kmplayer中打开均为中文乱码。系统为win7 64bit.
修正方法
单次操作:运行Notpad++(或者记事本),打开srt字幕,切换到“以UTF-8格式编码”,然后按Ctrl+S保存一下。
批量操作:使用powershell。
流程
-
win7 更新powershell (失败,可能系统为ghost版本,powershell 更新后启动即停止响应)。
-
在视频合集根目录下运行程序 captain.ps1
$a = Get-ChildItem -include *.srt -Recurse |select fullname
foreach($i in $a)
{
$file = Get-content -LiteralPath $i.Fullname -Encoding UTF8;
Set-Content -LiteralPath $i.FullName -Value $file -Encoding UTF8;
}
- Note
路径里有特殊符号,要使用 -LiteralPath