This project is read-only.

Problems with chinese characters showing up as ???????

Topics: Localization, 中文(Chinese)
Mar 10, 2014 at 10:28 PM

I am currently building a multlangual orchard-site with support for both english and chinese. However, when i try to translate it into chinese the letters are then returned as ?????? and not chinese letters.

I have done some research and i think the problem is database-related. I have set the collation to utf8_unicode_ci but it is still showing up wrong.

I use the MySQL driver with Orchard.

Any tips?

Mar 13, 2014 at 12:53 AM

I had the exact same problem. This is what I learned. It has to do with the collation of the database. However, in MySQL, once you set the collation, in only affects the tables you create from that point on. The previous tables you already created will use the old collation, so you characters will continue to appear as ????. What I had to do, was to completely delete the database, set the collation in MySQL, then do a fresh install of Orchard. No more problems after that.
Apr 3, 2014 at 9:19 PM
I still have major problems with this issue, is there someone who can help?
Apr 3, 2014 at 10:43 PM
If the characters are from the view templates, that is .cshtml files, then you can check if the file character encoding is UTF-8 for those files in your theme, or if there are some templates not overridden by your theme, but third party modules, then those in module Views folder.

If they are from the content database, then there might be something wrong with DB collation settings. I don't know what collation needs to be used for chinese though.

Apr 23, 2014 at 9:06 PM
I had the issue fixed in 1.7.2.

The solution:
After i had installed a clean version of Orchard, double-checked the collation set to utf8_unicode_ci in the database and the character encoding is set to utf-8.
I also had to add an extension to the connection string (via App-data > sites > default > settings.txt) with ;charset=utf8. The problem seemed to be solved.

However, after i installed 1.8 the problem still exist and cannot be solved using the above mentioned.