Friday, July 24, 2009

Multi-Lingual Encoding

I have built many websites in many different spoken languages. But one site in particular has taught me a few valuable lessons when it comes to building a website with special encoding. That site was a Japanese website.

This site was built in classic ASP and includes are a common component in this code. An include is it's own page and used mainly for items that can be reused throughout the site, such as the header, navigation, or even functions. That page is then included on each page you use it on. It's extremely valuable and efficient for large sites.

Well in the past, I used to build all the
components into the include file. A typical include would contain the title tags and all meta tags as well as any encoding for language. The Japan site has taught me not to put the encoding in the include. I frequently get content that's written in Japan and when that content transfers to the US, it is all jumbled without the encoding. It is more valuable to have that encoding on each and every page so you get the characters to show correctly to the developer. Having it on the include ensures users can always see the site correctly in their browsers, so it's never a problem to users. But to developers it's a nightmare and if you add the encoding to the page after it's jumbled, the encoding makes sure it stays jumbed, even to the end user at this point. So you can't add it afterwards without messing everything up and therefore you are stuck working on a jumbled page forever.

The lesson learned is to break out the encoding on every page when you are designing a site. In Japan's case that code is
<meta equiv="Content-Type" content="text/html; charset=shift_jis">

As a side note, I now also put all the elements in the
on each indivivual page for better SEO. For SEO, it's helpful to have unique title tags, and meta tags for every page. You can still do this on an include by using variables, but I think you can achieve more meaningful meta data/descriptions by placing these tags on each page thereby making your search engine display more helpful to users and more accurately pinpointing their needs.

So leave the includes for navigation and functions and let the
have it's own space at the top of every page.

No comments:

Post a Comment