How to show Chinese Characters in an English Forum

Started by stageducky, November 03, 2008, 10:36:52 AM

Previous topic - Next topic

stageducky

I would like to know how to show chinese characters in  an English Forum. I have already read some post and have tried changing server setting to English UTF-8 and also tried English British UTF-8 but it still show a "peace face and question marks" Any idea what's wrong? 

Can someone send me to any link that may answer this question. Or anyway that can provide step by step ways on how to change setting to make it work?

Thanks, appreciates

Compuart

Basically, Chinese characters can be shown in any forum, regardsless of the character set. If the character set the forum is in does not contain Chinese characters, the browser will automatically send HTML entities. HTML entities look like { and should support the full Unicode range. Note that it is advised to use UTF-8 in case you want to show multiple languages.

There are about two likely reasons why you wouldn't see the characters properly: you're mixing character sets (e.g. the forum is in a different character set than the language files, the forum used to use a different character set than it's currently using, etc.) or your browser/computer/font has no support for Chinese characters.
Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

stageducky

Hi Compuart,

1) I used English for the Forum because of some of the mod that I have installed.
2) My Computer reads Chinese Character without any problems in other websites and chinese website even.
3) I have Chinese font installed in my computer system too.

I have tried changing the forum language setting to utf-8 but the Chinese Character still didn't show. In place was the smiley face and "?"

I have tried changing phpmyadmin but there is no utf-8 selection. Any further possibility?

Sarge

stageducky, you're not supposed to change table collations from phpMyAdmin, as you mentioned in your other topic, because the data will still be in latin1.

SMF can do the conversion automatically. By any chance, did you install SMF via Fantastico? Read Chinese and other special characters. for more information.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

stageducky

Hi Sarge,

Yes I did indeed installed through Fantastico. Thanks for info. I tried changing the collation. but reverted it back when nothing happened after the change. I will read the link you posted. Thanks

Sarge

#5
It's a Fantastico bug that causes the issue. The topic I linked to contains the fix. ;) Basically, you simply need to delete global_character_set from the smf_settings table and you should be able to see the UTF-8 conversion link in the SMF admin control panel. Carry out the conversion and you should be set.

Remember to get a full database backup before attempting anything. Conversion from UTF-8 is usually not reversible, especially when the data contains non-latin1 characters (Chinese etc).

Let us know how it goes! :)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

stageducky

#6
Hi Sarge,

Thanks for your help. My forum can show Chinese Text without any issue now. It was really a simple procedure. Just follow the instruction on going into phpmyadmin -> select the _smf forum database -> click on SQL tab -> Copy and past the lines that you have given into the query box and hit go... there wasn't any need even to run convert from HTML to UTF8.

Thanks very very much. Really appreciate your help.

Antechinus

Ok, I have a similar dilemma, but I want the ability to use Arabic in posts.

Note that I don't require themes or mods themselves to support Arabic. In fact I'd prefer that they didn't (to make administration easier).

All I want is the ability to display Arabic in posts and nowhere else, preferably without it being necessary to change any settings when using both Arabic and English in the same post. 

Is this what a standard UTF-8 conversion will give me?

To put it another way, what is the minimum required to get the result I want?

agridoc

antechinus you can use UTF-8, otherwise you can "cheat" by changing the codepage in index.english.php to windows-1256 or ISO-8859-6.

In Multilingual in SMF 1.1RC2 without UTF for Greek and other languages? you can find more on this solution.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

Antechinus

Awesome. Thanks for the tip. Cheating sounds like fun. :D

Antechinus

Ok, I read the link but am rather puzzled. This bit:

Quote from: agridoc on July 18, 2006, 05:56:20 PM
It's an old topic but I should write what happens.

SMF RC1 and RC2 don' t need a patch to work this way in a Unix or Linux server.

implies that 1.1.7 should display other languages without using this hack.
What am I missing?

agridoc

There is no need for patching 1.1.7

I downloaded chinese languages for SMF and I found

In index.chinese-simplified.php
$txt['lang_character_set'] = 'gbk';

In index.chinese-traditional.php
$txt['lang_character_set'] = 'big5';

In SMF 1.1.7 installation
In index.english.php
$txt['lang_character_set'] = ISO-8859-1;

By changing here ISO-8859-1 to gbk or bg-5, depending on chinese selection, one may have SMF with english menu showing correctly chinese stored with SMF using chinese language. I can' t test, I believe it should work.

You can test in my site http://www.aeromodelling.gr/ForumS/index.php?language=english&topic=44.msg2540#msg2540 , I had added forced English. You can test as a guest without subscription. Same approach, for Greek and windows-1253.

It's a good solution for an old working forum or for ISO-8859-1 and another character set language, no need for database conversion. However, for true multilingual and many languages, UTF-8 is the proper solution.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

Antechinus

Agridoc, you're a genius.  ;D  I just tested it on my local host and it appears to work perfectly.
Arabic text is displayed nicely. All BBC tags work on it (ie: bold, size, etc).
The forum still runs in English just like it should and  there don't seem to be any error messages being generated.
Thank you very much. I owe you one.

agridoc

Ooops! I forgot you were interested about arabic. Proper codepage windows-1256 or ISO-8859-6.

It's nothing but a simple trick.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

Antechinus

#14
Yup.The odd thing is that I tried windows-1256 on my local host and it works perfectly, but it wont work online with my public server. I'll test ISO-8859-6 now and see if that works.

ETA: Nope, that doesn't work either. It's good on my local but no good online.

agridoc

Strange. A link of the working forum might help.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

Antechinus

Hey that's weird. I just tried it on a test site and it works!
Check this out.  :D

Maybe the file edit via ftp didn't take properly on the main site. I'll try it again and see what happens. Also we were testing it in a private board so it is possible ( ? ) that the permssions had something to do with it. Maybe? Possibly? Gremlins? Aliens?

Antechinus

#17
Ok, here's the main site where it doesn't work.
It's on the same server but runs in the public_html directory instead of in a sub-directory.
The post content is exactly the same but Arabic text wont display.

This is a funny one. :P

Identical quoted test post here.

ETA: Just thought of something. The only real difference between the two forums is mods installed.
Both have Tiny Portal 0.983 but the main site (where this trick doesn't work) also runs other mods


ETA2: One of the members who is rather nifty at computer stuff said this:

QuoteHey, I think it might be because of the "Content-Type" header sent by the server which overrides the content-type specified in the HTML document:

E.g.: Content-Type: text/html; charset=UTF-8

I tested this on another test site that runs exactly the same mods as the main site but runs in a sub-directory off public_html (IOW, on a mirror forum in a different folder).

Result: it works there. This means the problem is caused by the main site running directly from public_html. If it was in a sub-directory there would be no problem.

agridoc

antechinus, the link shows that the working SMF installation defaults to UTF-8, not ISO-8859-1.

In a proper UTF-8 installation there should not be any problem with Arabic, or any language. The same should apply for a proper ISO installation, in this case characters are stored as entities.

From what you write and what I see, it doesn't seem to be to be a host bug but rather a Fantastico bug. If the installation was done with Fantastico, it might cause this behavior by forcing UTF-8. If it was a Fantastico installation see Sarge's reply in this topic and do an extended search for Fantastico by Sarge, you will find there the solutions for correcting this.

After this is corrected you will be able to see what kind of installation is in your working forum and take the proper decision.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

Antechinus

#19
Aha! Good point. I'd forgotten about that because although I installed all the demo/mirror sites I didn't do the initial installation for the main site.  Someone else did that one and he did use Fantastico and it was originally set to UTF-8. I changed the server language setting in SMF admin to plain English to get rid of the masses of errors it was generating when set on UTF-8.

Right. I'll go do some searching. Thanks for the tip. :)


ETA: Read the other topic and basically that just says I have to convert my database to UTF-8 rather than just using the trick you use. I was hoping to avoid having to do the conversion.

Advertisement: