Displaying Chinese characters in MySQL
Posted by: Thor Russell
Date: January 18, 2007 09:47PM

Hi,
I am trying to display chinese characters with a MySQL database, but I am running into some problems.
I am using navicat v7.2.9 to edit the database,
MySQL 4,
and PHP 5

I set up the connection to the database using UTF-8 in the connection string.
I then went to the relevant table, and set the character set to:
utf8 and the Collation to utf8_unicode_ci. (what is Collation)

I then entered the following text into the database:
不是免費的,但其他免費的有很多,它是把
It is in the “PMingLiU” font

This is what appeared in the web page (after changing the encoding in firefox to utf-8)
�?是�?費的,但其他�?費的有很多,它是把
Many characters have been stuffed up somehow.
When I go to the websites source, I get:
�是�費的,但其他�費的有很多,它是把

UTF-8 and PMingLiu are the recommended char sets and fonts for displaying Chinese characters, what is going on here?

I then got the same text, and put it into a blank html file, with the encoding as UTF-8 and it displayed fine. What settings to I need in tMySQL to make it work?

Options: ReplyQuote


Subject
Views
Written By
Posted
3891
November 03, 2005 01:55AM
Displaying Chinese characters in MySQL
19255
January 18, 2007 09:47PM
5246
October 24, 2005 11:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.