Advertisement
jbjurstam

Notepad++ UTF-8

Sep 30th, 2016
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. from Npp import *
  2.  
  3. console.write("Converting all open files to UTF-8 and saving\n")
  4. console.write("---------------------------------------------\n")
  5.  
  6. filenames = notepad.getFiles()
  7.  
  8. for fn in filenames:
  9.     if (fn[0][:3] != "new"):
  10.         console.write(" - Converted and saved " + fn[0] + "\n")
  11.         notepad.activateFile(fn[0])
  12.         notepad.menuCommand(MENUCOMMAND.FORMAT_CONV2_UTF_8)
  13.         notepad.save()
  14.     else:
  15.         console.write(" - Skipped " + fn[0] + "\n")
  16.  
  17. console.write("\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement