【发布时间】:2012-01-27 01:22:02
【问题描述】:
我有以下代码从 mht 文件中检索日语或本地化字符串。我已经使用了这里列出的几乎所有编码参数(未知、字符串、unicode、bigendianunicode、utf8、utf7、utf32、ascii、default、oem)并经过验证。它总是打印垃圾字符而不是原始的中文或日文名称
$log = "c:\scripts\meta.mht"
$patt = 'title'
$indx = Select-String $patt $log | ForEach-Object {$_.LineNumber}
write-host (Get-Content $log)[$indx] | out-file -encoding string c:\scripts\temp1.xml
有人可以帮我打印本地化的字符串吗?我应该使用哪个编码参数? 我已经尝试了所有列出的参数,但没有运气(未知,字符串,unicode,bigendianunicode,utf8,utf7,utf32,ascii,default,oem)
提前致谢。
【问题讨论】:
标签: powershell