Powershell:设置Get-Content管道的编码 [英] Powershell: Setting Encoding for Get-Content Pipeline
本文介绍了Powershell:设置Get-Content管道的编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
cat tmp.log -encoding UTF8> new.log
生成的文件仍在UCS-2 Little Endian中。这是因为管道总是以这种格式吗?有没有一个简单的方法来管理这个新文件为UTF8?
解决方案
如建议 I have a file saved as UCS-2 Little Endian I want to change the encoding so I ran the following code: The resulting file is still in UCS-2 Little Endian. Is this because the pipeline is always in that format? Is there an easy way to pipe this to a new file as UTF8? As suggested here:
这篇关于Powershell:设置Get-Content管道的编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! Get-Content tmp.log | Out-File -Encoding UTF8 new.log
cat tmp.log -encoding UTF8 > new.log
解决方案 Get-Content tmp.log | Out-File -Encoding UTF8 new.log
查看全文