Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML

Character set and foreign languages

While revising the basics through the Web Design course I am working on my own website project. While I am initially working on an English verison, I will also create a version of the site in French and use Japanese text from time to time

Concerning the charset, is it ok to simply use utf-8 for everything or should I change to another charset for French and/ or Japanese? I made a (admittedly quick) google research and saw some people online mentioning IEC 8859 for French and EUC for Japanese. I also found one source saying using a utf-16 charset would result in smaller file sizes for documents using a lot of kanji (chinese characters).

Can anyone make some recommendations about this?

1 Answer

A.J. Kandy
PLUS
A.J. Kandy
Courses Plus Student 12,422 Points

According the Unicode Consortium, which sets these standards, UTF-8 covers all CJK character sets, so you should be able to use it without a problem for a page in Japanese. It also covers all European language character sets including diacritical marks and accents, so French shouldn't be a problem.

For both French and Japanese, remember use the lang attribute on your HTML element to make sure that browsers and search engines can parse it appropriately.

The last thing to make sure is that any specified fonts in your CSS support extended character sets. For the most part, OpenType fonts are a good bet, but you should check the specs and character ranges to make sure it has all the glyphs you need. You can easily find webfonts that support them, and recent OS native fonts are probably fine, but older fonts (TrueType), older OSes and/or things like phone fonts may be an issue, so be sure to check against common devices / OSes for the country you're targeting. (For instance, older feature phones vs. smartphones).

If you're using a CMS or plugin that supports multiple languages (for instance, WPML for WordPress) there are other steps to go through to make sure your themes and admin areas are translatable, but that may be a separate issue to explore later.