def convert2uft8(filename): #print filename filename = filename.encode("UTF-8") notepad.open(filename) notepad.runMenuCommand("Encoding", "Convert to UTF-8") notepad.save() notepad.close() print filename
def tearDown(self): editor.setSavePoint() notepad.close()
# -*- coding: utf-8 -*-
import os import sys from Npp import notepad filePathSrc = "C:\\server\\encode" for root, dirs, files in os.walk(filePathSrc): for fn in files: if fn[-4:] == '.yml': notepad.open(root + "\\" + fn) notepad.runMenuCommand("Encoding", "Convert to ANSI") notepad.save() notepad.close()
def tearDown(self): notepad.clearCallbacks() editor.clearCallbacks() editor.setSavePoint() notepad.close()