Vietnamese Website Character Issue
March 6, 2009 8:29 PM   Subscribe

I am developing a English/Vietnamese site but some characters in Vietnamese don't go over well, especially on Windows. For other sites there is no problem: what do I need to change to make it work?

I am developing a site and the baby beta is here. I am having problems with the Vietnamese characters as they seem to be not transferring properly from the server to the browser. The problem only comes up when using Windows and is especially clear when I look at the source code; somehow the rendered text looks fine most of the time. The exception is that the Georgia font should support VNese characters, but doesn't look right in IE6 (see the sidebar newsletter subscribe form). I think this is a related problem.

I think there is a problem with Apache, and have tried modifying the charset through .htaccess but that didn't work (AddDefaultCharset utf-8). I don't see what I'm doing differently in the source code, which makes me think it's a server issue. Any ideas?
posted by Timen to Computers & Internet (12 answers total) 1 user marked this as a favorite
 
Are you detecting my geo-zone? If not, then I would guess your tag

<meta http-equiv="Content-Language" content="en-us" />

is probably not helping. God, I hate character encoding.
posted by CaptApollo at 9:43 PM on March 6, 2009


Response by poster: CaptApollo,

Thanks for your reply. Actually, the other sites have that encoding as well... I truly thing it's some sort of communication issue between the server and the browser.

Take care,
Timen
posted by Timen at 10:05 PM on March 6, 2009


Response by poster: OK, so VNese in Windows in the code looks like this:
OutInSaigon.com là một cẩm nang hữu ích giúp bạn có được những buổi tối thú vị. Bằng cách liệt kê những quán café, quán bar, câu lạc bộ và những nhà hà ng nổi tiếng trong thà nh phố, cẩm nang sẽ gửi đến bạn tin tức mới nhất cho các sự kiện sắp diễn ra và o các buổi tối trong tuần.

instead of:

OutInSaigon.com là một cẩm nang hữu ích giúp bạn có được những buổi tối thú vị. Bằng cách liệt kê những quán café, quán bar, câu lạc bộ và những nhà hàng nổi tiếng trong thành phố, cẩm nang sẽ gửi đến bạn tin tức mới nhất cho các sự kiện sắp diễn ra vào các buổi tối trong tuần.
posted by Timen at 10:32 PM on March 6, 2009


Oh crud, you're right. Sorry I didn't see that.

Is your content coming from a database-driven CMS? It could be the encoding/collation there - I've definitely had that happen to me. (Way) Older versions of MySQL weren't so great at unicode support, but the later versions have worked well for me.
posted by CaptApollo at 10:43 PM on March 6, 2009


And to be clear, you say it's a problem on Windows - is it working OK on a Mac or Linux? On Safari on a Mac? What about Safari on a PC?

The fact that you are able to paste the two as separate sequences into Metafilter suggests to me that its a server-side issue, but I'd be interested to hear about it working elsewhere.
posted by CaptApollo at 10:56 PM on March 6, 2009


I think you might be mistaken in your belief that Georgia supports Vietnamese characters - these pages (search for vietnamese in the second link) seem to suggest otherwise.

I think (though I may be wrong) that the reason it doesn't work on Windows/Explorer is that other OSes/browsers may do font substitution, requesting a font that is capable of displaying the unicode character (instead of using the one specified on the page).
posted by mebibyte at 10:58 PM on March 6, 2009


Looks fine for me in IE7. Is this only an IE6 problem?
posted by sbutler at 11:01 PM on March 6, 2009


Response by poster: OK — I fixed half the problem with the following PHP code addition:

header('Content-Type: text/html; charset=UTF-8');

This has fixed it so that the code always displays correct. However, IE6 (not IE7) still doesn't display Georgia correctly. Is this an IE6 bug? If so, I guess the only solution is to make an IE6 specific stylesheet that puts in Arial, Helvetica, sans-serif in the places where there is now Georgia. Or is there a JavaScript to do this do that it's a little more dynamic?
posted by Timen at 12:43 AM on March 7, 2009


Response by poster: PS: Weird the Georgia works fine in one browser and not in another, huh? Makes me wonder if it is really an IE bug, a font problem, or still an encoding problem that IE6 doesn't fix itself and modern browsers do?
posted by Timen at 12:55 AM on March 7, 2009


an encoding problem that IE6 doesn't fix itself and modern browsers do

This is my bet, but if you find the answer, please add it here! I'd love to know.

Best luck!
posted by CaptApollo at 12:24 PM on March 7, 2009


> I guess the only solution is to make an IE6 specific stylesheet that puts in Arial, Helvetica, sans-serif in the places where there is now Georgia. Or is there a JavaScript to do this do that it's a little more dynamic?

No need for Javascript, just do that with a conditional stylesheet:

<!--[if IE 6]>
Special instructions for IE 6 here
&lt![endif]-->

Make sure it appears after the other CSS. Details here.
posted by AmbroseChapel at 3:54 PM on March 8, 2009


Sorry, code should be

<!--[if IE 6]>
Special instructions for IE 6 here
<![endif]-->

posted by AmbroseChapel at 3:55 PM on March 8, 2009


« Older Removing Overlay Text from Canon XL2 MiniDV   |   Why do double-paned windows have a 2cm gap? Newer »
This thread is closed to new comments.