I'm developing a website which has support for the most talked languages in the world, but my problem is that in some machines instead of letters, rectangles are displayed. So far this problem has been seen mostly with chinese, japanese and korean languages.

Somebody has an ideia on how to fix this issue?

3 Years
Discussion Span
Last Post by cdinarte

I am not sure if you have done this or not but your file has to be saved a utf-8 encoding, like this:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

To properly display non-English characters, such as Spanish, French, or Chinese, in MySQL you can define the character set value in ‘DB_CHARSET’ variable in the conf.php.

Kinda like this (forgive me if i made a mistake in this snippet, but it isn't easy writing this on my phone):

define('PHPGRID_DB_HOSTNAME','hostname'); // database host name
define('PHPGRID_DB_USERNAME', 'username'); // database user name
define('PHPGRID_DB_PASSWORD', 'password'); // database password
define('PHPGRID_DB_NAME', 'sampledb'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // OPTIONAL. Leave blank to use the default charset

I have done that and checked the headers using chromme developer tools, all the files are in utf-8(all the languages strings are in xml files). I've also have defined "charset=utf-8" in the PDO string with the connection data.


Most GUIs should support this - e.g. charset and collation in SQLyog:


IMPT - remember never use char - always use varchar


The db only uses varchar fields and I've tried changing the charset to 'utf8mb4' but the problem continues.
I believe the problem is missing fonts in the client computer, because the problem is only visible in some computers. I was able to fix Bengali and Hindu languages adding Google Fonts.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.