MySQL Forums
Forum List  »  PHP

Re: Newby needs some help - collation/charset ?
Posted by: Barry Galbraith
Date: December 16, 2013 07:35PM

Theres a number things that have to line up for characters to be represented correctly.

Th web page form you collec the data with has to be set to use the correct characterset (utf-8) to both render the form, and then submit the data for processing and storing.

There should be a line like this on the webform.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

That will tell your browser to display utf-8, and to post received data as utf-8.

Then, the page that processes the posted data has to connect to MySQL database, and set the encoding used on the link to use UTF-8.
That is done with the mysql_set_charset('utf8') command in the php script.
Then the database field the character is stored in has to be defined as utf-8.

When retrieving and displaying the data, you need to set the mysql link to use utf8, and set the webpage to display utf8.
If you don't set the characterset at any of these places you get the default, whatever that is :(

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: Newby needs some help - collation/charset ?
December 16, 2013 07:35PM


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.