我是靠谱客的博主 苗条钢铁侠,这篇文章主要介绍使用Notepad++批量转换源代码编码方式,现在分享给大家,希望可以做个参考。

Here some simple steps to convert multiple files via Notepad++ without messing up with special characters (for ex. diacritical marks).

  1. Run Notepad++ and then open menu Plugins->Plugin Manager->Show Plugin Manager
  2. Install Python Script. When plugin is installed, restart the application.
  3. Choose menu Plugins->Python Script->New script.
  4. Choose its name, and then past the following code:

convertToUTF8.py

import os;
import sys;
filePathSrc="C:\Users\" # Path to the folder with files to convert
for root, dirs, files in os.walk(filePathSrc):
for fn in files:
if fn[-4:] == '.xml': # Specify type of the files
notepad.open(root + "\" + fn)
notepad.runMenuCommand("Encoding", "Convert to UTF-8")
notepad.save()
notepad.close()

After all, run the script

最后

以上就是苗条钢铁侠最近收集整理的关于使用Notepad++批量转换源代码编码方式的全部内容,更多相关使用Notepad++批量转换源代码编码方式内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(113)

评论列表共有 0 条评论

立即
投稿
返回
顶部