Abd*_*Abd 5 encoding notepad++
我有 50 个文本文件需要从 utf-8 bom 转换为 ANSI。在 Notepad++ 中,我们可以用单个文件来完成,但我希望所有打开的文件都以一种简短的方式转换为 ANSI。那里有什么选择吗?
假设你的 utf8bom 文件位于c:\temp\utf8\
我正在将 ansi 文件保存到c:\temp\ansi\
在命令行中,
> powershell
PS> get-item c:\temp\utf8\*.* | foreach-object {get-content $_ | out-file ("c:\temp\ansi\" + $_.Name) -encoding default}
PS> exit
>
Run Code Online (Sandbox Code Playgroud)
它的作用是,对于 中的每个文件c:\temp\utf8,获取其内容并c:\temp\ansi使用 Windows 系统默认编码输出到具有相同文件名的文件,这相当于您所说的 ANSI。
get-content这里的命令可以读取文本,而无需指定带或不带 bom 的 utf8。