HOW TO: Change a document's (character) encoding / charset

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
Posts: 3783
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

HOW TO: Change a document's (character) encoding / charset

Post by Albert Wiersch »

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 CSS 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">
Quickly Convert Multiple Documents

Did you know? You can 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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Post Reply