Apart from problems with PHP compatibility issues, I found one bigger problem which seems to be troublesome for many people — UTF-8 file encoding.  It will be worse when you have to deal with a thousand files in your project.

Now I found the solution for that! I have search across the internet for the solution and I found one which works great for me! Let’s take a look.

TOOLS

The solution needs 2 tools, Notepad++ and its “Python Script” plugin. Let’s have it install.

1. you need to download and install Notepad++.

2. After installed Notepad++ successfully, go to menu “Plugins > Plugin Manager > Show Plugin Manager”.

3. Look for “Python Script” in the list. Then, select and install the plugin.

Now, you have all required tools to tackle you struggle.


How to do it?

You might say that you are not familiar with Python but that won’t be a problem here. I will show you step by step until it works.

1. Open Notepad++. Then, go to menu “Plugins > Python Script > New Script “.

2. Make sure that the script is saved in “PathToNotepad++\plugins\Config\PythonScript\scripts”

3. Name the file as “convertToUTF8.py” and then click save.

At this point, you will find that Notepad++ already open the file “convertToUTF8.py” and it is blank.

4. Put the code below in the file and then change several parameters below.

Check “filePathSrc” parameter. The path must be your project directory.

Also, you must check if the extension is correct at this line.

if the file has 5 character (i.e. html) you must change it to

Then, save the script.

5. The last thing you need to do is to run the script. Go to menu “Plugins > Python Script > Scripts > convertToUTF8”.

The script will automatically open the file with the specified extension and automatically convert the file to UTF-8. and then save the file for you.

You can go get some coffee now!

PS. If you find “Unknown Exception”, please follow the instructions.

Comments

comments