unicode - 脚本将文件另存为unicode

标签 unicode powershell cygwin

您知道我可以通过编程方式还是通过scrirpt将以ansi字符编码保存的一组文本文件转换为unicode编码的任何方式?

我想做的事情与使用记事本打开文件并选择将其另存为Unicode文件时的操作相同。

最佳答案

您可以使用iconv。在Windows上,您可以在Cygwin下使用它。

iconv -f from_encoding -t to_encoding file

关于unicode - 脚本将文件另存为unicode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/520150/

相关文章:

xml - 如何使用PowerShell编辑和保存XML节点

windows - 是否可以通过 ssh 进入 Windows(通过 cygwin sshd)并在登录的 Windows 用户桌面上启动程序?

php - 非 ASCII 情况下的正则表达式单词边界

regex - 使用正则表达式匹配除三个之外的 Unicode 控制字符

excel - 如何在powershell中读取Excel文件?

powershell - -command 的退出代码与脚本的退出代码不同

bash -/dev/stdin 与 herestring

android - 我可以在 Android 应用程序中使用 FFmpeg 的库吗?

python - 为什么 Python json.dumps 在混合 utf-8 和 unicode 字符串上失败?

c - 尝试读取带有表情符号的文本文件并打印出来