Board logo

标题: 批处理修改文本中文内容出现乱码的问题 [打印本页]

作者: wmysbbs     时间: 2009-7-27 08:13    标题: 批处理修改文本中文内容出现乱码的问题

这段批处理已经写好了,可是中文名的时候出现乱码

@echo off
set push="aaa.ini"
set /p NewName= 请输入游戏名:
set clear=.
for /f "usebackq delims== tokens=1,*" %%a in (%push%) do (
  if defined clear set clear=>%push%
  (
      if "%%a"=="PlayerName" (
        echo %%a="%NewName%"
      ) else (
        if "%%b"=="" (echo;%%a) else echo %%a=%%b
      )
  ) >> %push%
)




文本aaa.ini,内容如下

==============================================aaa.ini

[Log]
# 想要哪些日志,就在后面填写 True.
#
FileSystem=False
Account=False
UserID=False
[steamclient]
# 设置名字.
#
PlayerName="旧游戏名"
# 启用/禁用 steamclient.dll 生成记录文件.
#
# Default = False
#
Logging=False
# 更改以下设置,为服务器浏览器使用不同的主服务器!
#
#MasterServer=213.239.209.221

==============================================aaa.ini



PlayerName="旧游戏名"  这里的双引号可要可不要