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?

Recommended Answers

All 6 Replies

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.

@diafol, thanks for catching that

Member Avatar for diafol

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

597684982e60474b0a47c560e24bc522

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.