当前位置:网站首页>Batch modify the txt file code to UTF-8 (notepad++)
Batch modify the txt file code to UTF-8 (notepad++)
2022-07-05 07:37:00 【HAGUU】
Please like it , thank you ~Thanks*(・ω・)ノ
After two days of practice , Succeed in putting txt File from the ASCI turn UTF-8 And there is no garbled code in the text , The general steps are as follows :
- The computer has python( Previously installed ,windows Generally there are )
- Notepad++, plug-in unit - Plug-in management - install python script
- python script newly build script, Script name customization ( Such as :convertUtf8.py)
The script code is as follows :
import os;
import sys;
filePathSrc="C:\\decompile\\" # Path to the folder with files to convert
for root, dirs, files in os.walk(filePathSrc):
for fn in files: if fn[-4:] == '.htm': # Specify type of the files
notepad.open(root + "\\" + fn)
notepad.runMenuCommand("Encoding", "Convert to UTF-8") notepad.save()
notepad.close()
Related articles : The source of the above code
4. The first 3 Step by step .py The file in notepad++ open ( Such as :convertUtf8.py)
5. stay notepad++ Execute the script
Related articles : Method of execution
6. The first 5 After executing step plug-in unit -python script-scripts A new action bar is generated under “convertUtf8”
relevant :
. If you want to go from scripts Delete the script under the column , Then open the location where the script is saved , Delete file , restart notepad++ that will do
. If you want to edit this script , Press and hold ctrl And click the operation bar
7. To be transferred txt Put the file in the 3 Under the folder path mentioned in the script
8. Notepad++ Open... In 7 All the encoded documents to be transferred in step
9. Click on : plug-in unit -python script-scripts-convertUtf8
The first 9 After step execution, the file starts from notepad++ Automatically close , Code conversion succeeded .
边栏推荐
- Basic series of SHEL script (II) syntax + operation + judgment
- Butterfly theme beautification - Page frosted glass effect
- Chapter 2: try to implement a simple bean container
- DataGrid offline installation of database driver
- [idea] efficient plug-in save actions to improve your work efficiency
- editplus
- The number of occurrences of numbers in the offer 56 array (XOR)
- Numpy——1. Creation of array
- Apple terminal skills
- Idea common settings
猜你喜欢

And let's play dynamic proxy (extreme depth version)

QT small case "addition calculator"

Graduation thesis project local deployment practice

Explanation of parallel search set theory and code implementation

行测--资料分析--fb--高照老师

MySql——存储引擎

Hdu1231 maximum continuous subsequence (divide and conquer or dynamic gauge or double pointer)

The folder directly enters CMD mode, with the same folder location

Altimeter data knowledge point 2

Set theory of Discrete Mathematics (I)
随机推荐
CADD course learning (6) -- obtain the existing virtual compound library (drugbank, zinc)
Pagoda create multiple sites with one server
Course learning accumulation ppt
Apple animation optimization
With the help of Navicat for MySQL software, the data of a database table in different or the same database link is copied to another database table
借助 Navicat for MySQL 软件 把 不同或者相同数据库链接中的某数据库表数据 复制到 另一个数据库表中
Mouse click fireworks explosion effect
Exit of pyGame, idle and pycharm
Ggplot2 drawing learning notes in R
Basic series of SHEL script (III) for while loop
Basic operation of external interrupt (keil5)
Simple operation with independent keys (hey, a little fancy) (keil5)
QT small case "addition calculator"
Play with grpc - go deep into concepts and principles
Cygwin installation
Ugnx12.0 initialization crash, initialization error (-15)
R language learning notes 1
Efficiency difference: the add method used by the set directly and the add method used by the set after judgment
editplus
DataGrid offline installation of database driver