MySQL Forums
Forum List  »  PHP

Re: Charset SESSION vs GLOBAL
Posted by: Rick James
Date: March 27, 2011 07:17PM

Both the field and the data are latin1.
Here is one of _many_ online Ascii charts (close to, or identical to latin1):
http://ascii-code.net/#tab2 . Notice the entry for hex E9.

In utf8, you would see two bytes: C3 E9
http://www.fileformat.info/info/unicode/char/00e9/index.htm

So, depending on whether you _want_ to deal with latin1 (like E9) or utf8 (like C3E9) in your PHP code, you can user or skip
mysql_set_charset('utf8'); or mysql_query('SET NAMES utf8');
As long as you achieve that, the trancoding will be automatic.

Have you considered switching to mysqli_* (instead of mysql_*) API in PHP? It may have the issues solved. (Sorry, I can't be more specific.)

mysqli_* is very similar to mysql_*:
http://us2.php.net/mysqli
but is not available on older versions of PHP.

Options: ReplyQuote


Subject
Written By
Posted
March 26, 2011 03:37PM
Re: Charset SESSION vs GLOBAL
March 27, 2011 07:17PM
March 28, 2011 12:26AM


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.