How to change a document's encoding

Post here if your topic is about CSS HTML Validator but doesn't fit in another forum.
Post Reply
User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3299
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

How to change a document's encoding

Post by Albert Wiersch » Mon Apr 18, 2016 10:27 am

I'm posting this here because it may benefit multiple people.

Today, most Internet documents should use UTF-8 encoding. If you have a page that is not UTF-8, like one that has one of these lines that specify ISO-8859-2 encoding:

Code: Select all

<META HTTP-EQUIV="Content-Type" content="text/html; charset=ISO-8859-2">
or

Code: Select all

<meta charset="ISO-8859-2">
Then it is recommended that you convert it to UTF-8. To do this:
  1. Load the document in CSE HTML Validator.
  2. Go to File->Save with Encoding and select "Unicode (UTF-8)" and make sure that the "Use encoding signature" option is not checked.
  3. Click OK to save the document with UTF-8 encoding.
Now change the old HTML to specify UTF-8:

Code: Select all

<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8">
or

Code: Select all

<meta charset="utf-8">
New in CSE HTML Validator v16.02

In CSE HTML Validator v16.02 and above, you can now hold down the 'Shift' key while selecting 'Save All' to select an encoding (like UTF-8) and use it to resave all opened documents with the selected encoding. You can then do a Search->Replace in All Open Documents operation to change 'ISO-8852-2' (or whatever encoding you are switching from) to 'utf-8'.

This is a quick way to convert multiple documents.
Image
Albert Wiersch

Post Reply