【发布时间】:2017-07-07 22:42:28
【问题描述】:
我正在编写一个 PowerShell 脚本来查找和替换包含东欧字符的 xml 标记并将它们更改为英文。
我的源文件以 UTF-8 编码。
我的代码:
$content = [System.IO.File]::ReadAllText("file.xml").Replace("<Číslo_zboží>","<Code>")
[System.IO.File]::WriteAllText("file.xml", $content)
虽然我可以成功地找到并用标准英文字符替换标签,但 PowerShell 会忽略那些包含东欧字符的标签。非常感谢您的建议。
【问题讨论】:
标签: xml powershell