Batch search and replace text inside files with UTF-8

      Comments Off on Batch search and replace text inside files with UTF-8

Today I had to replace some texts inside a large number of files. Doing this by hand would be too much work, that’s why I wanted to find a program that could do that. I am already using a program called Replace in Files and of course I used it for this task as well. Soon I noticed that the files were scrambled… because they were supposed to be encoded in UTF-8. Apparently the tool doesn’t take the file encoding in account, so the result is not what I’d expect.

I decided to search for another tool on the web. I wanted it to be free (as freeware author I try to use as much free software as possible), so I took a little more time for research. I found a few tools that claimed to be UTF-8 compatible, but none of them was free. I even downloaded and installed Multiple search in files, but have soon found out that it only searches in files but doesn’t replace the text…. And without replacement it was no use for me, so I unistalled it soon.

I know that developer tools like Eclipse have these features buit in, so I remembered of my freeware developer tool for writing and editing PHP, PSPad. It has some great features, it supports UTF-8 (that’s the reason I’ve chosen it in the first place), and it’s free. Maybe it has search and replace in files as well, was my thought.

The option was really there: just go to main menu -> Search -> Search / Replace in files… and fill in the fields! You can even choose the character encoding for the search, and UTF-8 is supported.

It looks like free software won again!