I have a large number of files that are either in Windows encoding (CP-1252) or UTF-8 without BOM.

Since those cause problems in my application, I'd like to convert them to UTF-8 with BOM. I did this in Notepad++ for a number of files, but I just found out I have to process ~600 more files, which sounds just like a task for being automated.

The tool must

  • be gratis
  • work on Windows (7 SP1 x64)
  • find files by standard DOS pattern (e.g. *.txt)
  • find files recursively (like a /r switch on command line)
  • write back to the input file, not to a new file (no worries: it's under version control)
  • detect if a BOM is already present and ignore those files
  • distinguish CP-1252 from UTF-8, which isn't an easy task

I don't care

  • whether it's a GUI or command line tool


  • it can process other encodings as well, e.g. via command line switch
  • Did Notepad++ automatically distinguish between CP-1252 and UTF-8? – RockPaperLizard Dec 22 '15 at 12:27
  • @RockPaperLizard: no, it didn't. I decided that manually. – Thomas Weller Dec 22 '15 at 14:15
  • Maybe check out this guy's project? stackoverflow.com/a/5830708/3543437 – kayleeFrye_onDeck Dec 23 '15 at 19:16
  • If there's nothing around, are you open to play with AutoHotKey and create simple converter by yourself? I have done that when I needed it (I needed to convert 2000+ files) with AHK + Notepad++. – miroxlav Dec 25 '15 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.