Board logo

标题: [文本处理] 【已解决】求bat:将ANSI文本 转为:UTF-8(无BOM)格式,谢谢 [打印本页]

作者: yyz219    时间: 2024-1-21 12:56     标题: 【已解决】求bat:将ANSI文本 转为:UTF-8(无BOM)格式,谢谢

本帖最后由 yyz219 于 2024-1-21 18:43 编辑

完美解决了:
coder.exe(http://bcn.bathome.net/tool/coder.exe
coder -c ansi utf-8 -f "ansi.txt">"utf-8.txt"
=======================================

原来的问题:
求bat:将ANSI文本 转为:UTF-8(无BOM)格式,谢谢
(我的基础太差,本论坛搜索到的看不懂)
作者: ShowCode    时间: 2024-1-21 13:20

回复 1# yyz219


V1.bat
  1. @echo off
  2. set "OldFile=1.txt"
  3. set "NewFile=2.txt"
  4. powershell "[IO.File]::WriteAllLines('%NewFile%',(Get-Content '%OldFile%' -Raw))"
复制代码

作者: yyz219    时间: 2024-1-21 18:02

回复 2# ShowCode


    我试一试先 谢谢
作者: yyz219    时间: 2024-1-21 18:07

回复 2# ShowCode


    'powershell' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
====================================
电脑里面没有powershell

有其它办法吗?谢谢
作者: hfxiang    时间: 2024-1-21 18:32

回复 1# yyz219

试试coder.exe(http://bcn.bathome.net/tool/coder.exe
  1. coder -c ansi utf-8 -f "ansi.txt">"utf-8.txt"
复制代码

作者: yyz219    时间: 2024-1-21 18:38

回复 5# hfxiang


    我试一试 先 谢谢
作者: yyz219    时间: 2024-1-21 18:41

回复 5# hfxiang


    成功了 再次感谢




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2