Forum Moderators: open

Message Too Old, No Replies

Languages and utf-8 problems

trying to use Vietnamese for a website but getting only??

         

emacksey

12:38 pm on Apr 18, 2007 (gmt 0)

10+ Year Member



Well I wasn't to sure where to post this but i'm having a problem with Vietnamese characters showing up on my site.

I have php 4 and I'm running Mysql 5

for Mysql i have :
MySQL charset: UTF-8 Unicode (utf8)

MySQL connection collation: is utf_8_unicode_ci

For my html I have a meta tag :
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

I can't seem to get these Vietnamese characters to show up.

I really need help before i pull all my hair out.

Thanks,
Ehrin

<Sorry, no urls or site reviews.
See Forum Charter [webmasterworld.com]>

[edited by: tedster at 5:31 pm (utc) on April 18, 2007]

adb64

12:57 pm on Apr 18, 2007 (gmt 0)

10+ Year Member



Hi emacksey,

Does the font you have installed on your PC support those characters?

regards
Arjan

[edited by: tedster at 5:36 pm (utc) on April 18, 2007]

tedster

5:38 pm on Apr 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a related discussion from a while ago - it may stimulate some other ideas for you:

encoding for thai and vietnamese [webmasterworld.com]

Dabrowski

6:46 pm on Apr 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have an app running Perl 5 and MySQL 5.

Not had and problems using charset UTF-8 in the <meta>, the data is stored in the DB using the DBI 'quote' function, not sure if it actually alters it, I know it's similar to escaping characters. And I don't know how the PHP MySQL functions work.

The other thing you could try is escaping the content to store it and unescaping it to print it to the page.

You really need to find out if it's being stored in the DB correctly first.

penders

9:24 pm on Apr 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For my html I have a meta tag :
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Is it possible that your webserver is returning an alternative charset encoding in the HTTP response header and therefore overriding your HTML meta tag...?

encyclo

12:59 am on Apr 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't seem to get these Vietnamese characters to show up.

What is happening exactly when you view the page? Do you get lots of little squares, or lots of strange characters?

If the former, then probably the content is in UTF-8 but you don't have the required font to display it. If the latter then the content is either in a different charset to UTF-8 (try changing the charset in the browser to one of the legacy Vietnamese ones to identify it), or the content is in UTF-8 but the page is served as a different charset (press Ctrl+I in Firefox to see what encoding is being used).

tomda

1:34 am on Apr 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Before using my suggestion below, first investigate using Encyclo's advice to find out if it is a font problem...

Otherwise, try:
A/ mb_internal_encoding("UTF-8");
B/ mysql_query("SET NAMES 'utf8'"); afer connecting to the db

Tomda

Dabrowski

10:44 am on Apr 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



lots of strange characters

Maybe this is actually Vietnamese? ;)