Skip to main content
September 15, 2012
Question

Charset or Collation Problem? - Multilingual website

  • September 15, 2012
  • 3 replies
  • 1198 views

Hi

The charset for all the pages on my multilingual website are set as iso-8859-1. The collation for the fields in the table of my database is utf8_unicode_ci. I know I set my charset as iso-8859-1 to get rid of the little black triangles with question marks inside (from the PHP/table data). The European languags are working fine but my Japanese and Thai don't display as anything on the website (except question marks) (but in the SQL database they're fine). The HTML language is also set for each language.  I don't know too much about all of this. Can anybody help me out?

Many Thanks

Chris

This topic has been closed for replies.

3 replies

sudarshan.t
Inspiring
September 15, 2012

On another note, your issue may be because of a handful of other factors, leaving apart the encoding/ collation. The font you're using for Japanese/ Thai may be an unicode font and may not be a webfont - meaning your system wont display it correctly if you dont have it locally installed. The best solution is that you give us a URL so we can take a look!

September 17, 2012

Hi

When I change to UTF-8 I get a lot of black diamonds with question marks inside where the PHP encounters strange characters. And the Japanese and Thai characters are not displaying : just as ??? a question mark per character.

I can't leave the site like this to show you. But my SQL collation for fields is UTF8_unicode_ci and by charset for the html header is UTF-8. The language of each page is also set to the ISO-639-1 language code.

Is there anything I need to specifiy in the PHP code?

It seems like when I paste content into my main content area it shows the characters fine. But there seems to only be a problem in the navigation bar...are there any functions or coding issues which can cause problems in multi-lingual websites that I should be aware of?

Thanks

Chris

September 17, 2012

yo

solved the problem.

I hadn't included: mysqli_set_charset($dbc, 'utf8');

After I did this it worked fine.

Chris

David_Powers
Inspiring
September 15, 2012

cripaustin wrote:

The European languags are working fine but my Japanese and Thai don't display as anything on the website (except question marks)

That's not in the least surprising. iso-8859-1 is the character encoding for Western European languages. It doesn't support Asian scripts. Change the encoding to UTF-8.

Collation has nothing to do with encoding. It controls the sort order of data. For example, in the traditional Spanish sort order, LL is treated as a separate letter from L.

sudarshan.t
Inspiring
September 15, 2012

Can you post a URL to your website? That will help us in understanding where your problem might result from and thereby guide you solve it.