原方出处:http://stackoverflow.com/questions/7256049/notepad-converting-ansi-encoded-file-to-utf-8

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

如果要转化为ANSI 就把插件代码改为下面

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

<转>巧用notepad++ 批量转换ansi 和 utf8的更多相关文章

  1. 批量转换编码 (gbk -> utf8)

    使用 Notepad++ 批量的转换文件编码:Mass convert a project to UTF-8 using Notepad++ 步骤如下: 1.一般 Noptepad++ 安装完后已经自 ...

  2. py2.7 批量转换文件为 utf8 编码

    source insight 不支持 utf8 ,但是在 linux 上查看的时候是 utf8 编码,就会显示不正常,所以写了个 python 小脚本,可以批量转换 py2.7 #coding:utf ...

  3. 【问题解决方案】editplus中批量将ANSI转换为utf-8

    来自一个用editplus写java程序但是上传到GitHub里中文乱码的故事 大致步骤: editplus全部打开之后(打开为何种编码不重要): (全部打开是指在左下方的文件列表选中-->右击 ...

  4. 把ANSI格式的TXT文件批量转换成UTF-8文件类型

    把ANSI格式的TXT文件批量转换成UTF-8文件类型 Posted on 2010-08-05 10:38 moss_tan_jun 阅读(3635) 评论(0) 编辑 收藏 #region 把AN ...

  5. 使用Notepad++实现批量将ANSI转成为UTF-8编码

    http://blog.sina.com.cn/s/blog_5f4150730101b3ok.html 使用Trados2011翻译英文html后,如果是单个文件,可在另存译文时选择Encoding ...

  6. 解决Qt中文乱码以及汉字编码的问题(UTF-8/GBK)——ubuntu环境设置默认是utf-8,文件编码可使用Encodersoft批量转换

    一.Qt环境设置 文件从window上传到Ubuntu后会显示乱码,原因是因为ubuntu环境设置默认是utf-8,Windows默认都是GBK.Windows环境下,Qt Creator,菜单-&g ...

  7. Linux下将UTF8编码批量转换成GB2312编码的方法

    Linux下将UTF8编码批量转换成GB2312编码的方法 在sqlplus中导入UTF8编码的sql脚本就会出现乱码错误,这时就需要将UTF8编码转换成GB2312编码,下面为大家介绍下在Linux ...

  8. 如何将lrc歌词文件批量转换为ANSI编码?

    有些MP3.MP4或学习机只能播放ANSI编码的歌词文件,可是从网站上下载的歌词大多是UTF-8或者其它机器支持不了的编码,如何批量将这些lrc歌词文件转换成ANSI编码的文件呢? 工具/原料 萍客T ...

  9. innodb数据库批量转换表引擎为MyISAM

    2013.0106 innodb数据库批量转换表引擎为MyISAM 来源:本站原创 PHP, 数据库, 系统技术 超过488名童鞋围观 1条评论  <?php //连接数据库 $host='lo ...

随机推荐

  1. (2)创建发布Maven

    一.创建maven项目 (1)命令行 mvn archetype:generate (2)选择模板默认是7 (3)输入组织号.项目名称及版本号.包名 回车确认 创建成功 二.转成idea项目 进入跟目 ...

  2. CF 115 A 【求树最大深度/DFS/并查集】

    CF A. Party time limit per test3 seconds memory limit per test256 megabytes inputstandard input outp ...

  3. HDU 1308 What Day Is It?(模拟,日期)

    解题报告:输入一个年月日,让你求出那一天是星期几,但是做这题之前必须先了解一点历史.首先在1582年之前,判断是否是闰年的标准是只要能被四整除就是闰年, 然后在1752年9月2号的后的11天被抹去了, ...

  4. Python_Tips[7] -> 偏函数

    偏函数 / Partial Function 使用偏函数可以对函数的部分预先知道的参数进行冻结,从而缓存函数参数,而在运行时再释放参数进行使用.所以偏函数适用于需要多次调用同样一个函数且其中一个参数固 ...

  5. 训练指南 UVALive - 3415(最大点独立集)

    layout: post title: 训练指南 UVALive - 3415(最大点独立集) author: "luowentaoaa" catalog: true mathja ...

  6. 1.4(Mybatis学习笔记)关联映射

    一.一对一 mybatis处理一对一主要通过<resultMap>中的<association>元素来处理. <association>元素主要使用方方式有两种: ...

  7. OC语言基础之NSDictionary

    1.NSDictionary字典的创建 1: // key value 2: // key -==> value 3: NSDictionary *dict = [NSDictionary di ...

  8. [HTML/CSS]margin属性用法

    概述 在一些小的项目中,前台样式还是需要自己来写的,这时候,margin在布局中还是有一定的地位的.上篇文章中介绍的盒子模型中,就有margin的存在. margin margin可以用来设置css块 ...

  9. notepad++ 常用的插件及教程

    NotePad++ 教程 HEX-Editor      http://files.cnblogs.com/pengdonglin137/HexEditor_0_9_5_UNI_dll.zip 我的N ...

  10. easyui datagrid加载成功之后选定并获取首行数据

    //加载成功之后,选定并获取首行数据 onLoadSuccess:function(data){ alert("grid加载成功"); var rows=$('test').dat ...