Character Encoding
A webpage can contain any number of different languages. The character encoding of a site specifies how those languages are stored on your Host. The choice of encoding is a trade-off between the support of unusual characters and the size of the HTML.
Sandvox offers four different choices of character encoding:
- US-ASCII
- Only handles basic letters from the Roman alphabet. For example, it cannot handle characters with accents. In order to handle any characters not supported by ASCII, Sandvox must convert them into a special numeric code that takes up a lot of space. Therefore, this choice is only really suitable for English sites.
- ISO-8859-1 / Latin 1
- Similar to ASCII but with better support for accents. Will handle most European languages efficiently.
- UTF-8 (Recommended)
- The recommended choice for most sites. It supports all characters without taking up much space.
- UTF-16
- Requires more space than UTF-8. However, it is more efficient at handling languages without European characters (e.g. Japanese, Chinese, Korean, Russian, Hebrew, Arabic, Greek, and Hindi). So if your site is in such a language, UTF-16 is generally the best choice.
If you do choose UTF-16 encoding, you may encounter problems with some JavaScript-based services such as Google Maps, or any that you use yourself via a Raw HTML object or Code Injection. This is usually due to the fact that the scripts are stored in a format like US-ASCII or UTF-8. To work around this issue, you can usually specify a charset parameter in the <script> tag. Or, switch your website's character encoding to UTF-8.
To set a site's Character Encoding:
- Open the Document Inspector.
- Go to the "Site" tab.
- Set the Character Encoding from the "Character encoding" popup.
Contact Form
If you are using the Contact Form and you wish to receive messages with characters outside of the character set you have specified (for instance, letters in a different language, or Emoji), you should encode your site as UTF-8 or UTF-16. Otherwise, those characters will be transmitted in a numerically encoded fashion that you won't be able to read!
Host Setup
While using the Host Setup Assistant to prepare a site for publishing, Sandvox checks the Host used to see if it always serves pages using a particular character encoding. If this is the case then the assistant will automatically set the site's encoding to match that of the Host.
Keywords: character, encoding, code, coding, characters, letter, encode, incode, incoding, japan, japanese, china, chinese, east, eastern, charset, charsets