RE: [PHP-I18N] storing unicode in mysql database

[email protected] ("Tex Texin")
Newsgroups php.i18n
Message-ID <[email protected]>
When you say the browser charset is set to utf-8, how are you doing that?

If the browser is converting the thai characters to numeric character
references (I assume that is what you mean by html codes: e.g. &#ddddd;
where d is a decimal digit) then most likely the page that is accepting user
data is not set to the right encoding.

Make sure the http protocol specifies the encoding is utf-8 and not iso
8859-1, or if the http protocol is not setting charset, then make sure the
web page is setting it to utf-8 (<meta http-equiv=Content-Type
content="text/html; charset=UTF-8">).

Tex Texin
Internationalization Architect,   Yahoo! Inc.
 
 


> -----Original Message-----
> From: Naintara [mailto:[email protected]] 
> Sent: Monday, January 30, 2006 3:32 AM
> To: [email protected]
> Subject: [PHP-I18N] storing unicode in mysql database
> 
> 
>  
> Hi,
> 
> I'd like to know what would be the best way to store Unicode 
> text in a database. I am using MySQL 4.1. I am trying to 
> create a multi-lingual CMS and the browser charset is set to 
> utf-8 and the database and tables are set to UTF8 and 
> utf8_bin for charset and collation.
> 
> While displaying in the browser, Thai text is displayed 
> correctly but it is stored as html code in the database. Is 
> this correct behaviour or is there a better way? Would I need 
> to specify charset for every query, or is it enough to have 
> specified it for the mysql connection, results and client 
> charset options.
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 267.14.23/243 - Release 
> Date: 27-Jan-06
>  
> 
> -- 
> PHP Unicode & I18N Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.