Re: [PHP] PHP charset encoding
if the page that the input form is on sets utf-8 as the content type, then most (?) browsers will send utf-8. you can use a meta tag like: meta http-equiv=Content-Type content=text/html; charset=utf-8 utf-8 characters are 8 bit clean, so they can be stored and retrieved in mysql 3.x ok, but proper utf-8 sorting etc. doesn't work. for many purposes though it seems to be ok. single characters in utf-8 encoding do look like multiple characters as far as 8 bit text handling programs are concerned (so yes, 15 characters in iso-8859-1 or ascii isn't the same length as 15 characters in utf-8). fonts that support utf-8 are required for properly displaying utf-8, and you have to specify utf-8 on the display page (either via a content-type header or with content-type meta tag as above) to get the browser to use the right fonts. - rob Always use Content-type header, because the meta is overrided by the ISO-8859-1 default in php.ini. Also, use *DOS* as the encoding in MySQL to work w/ UTF-8 characters. Also, remove the default encoding in Apache server (if you're using one) because it also overrides meta tags in html files. After the proper header is sent, it is the duty of the client (browser) to find relevant fonts. However, make sure you use the lang and xml:lang attribute in your html/xhtml to select your locale. (different locale use a different set of fonts) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP charset encoding
On Tuesday 30 March 2004 19:31, Rob Ellis wrote: On Tue, Mar 30, 2004 at 11:23:03AM +0300, nabil wrote: When submitting a data from an HTML page and inserting them in MySQL: what encoding they will be ? is it the page encoding? the field size like VARCHAR 15 won't fit the same in both encoding for the same text. !! Is the font any relation with encoding? phpmyadmin doesn't support UTF-8 so dumping your data using it will screw it up is it a way to convert it inside the database... Explain to me please , or if you can tell me where to find my answers (not google) if the page that the input form is on sets utf-8 as the content type, then most (?) browsers will send utf-8. you can use a meta tag like: meta http-equiv=Content-Type content=text/html; charset=utf-8 What we have done in a similar situation is to set the client encoding in php.ini as below and this solved the same problems as you describe: == default_mimetype = text/html default_charset = utf-8 = Hope this helps. Best regards, -- Integrated Management Tools for leather industry -- http://www.leatherlink.net Ma Siva Kumar, BSG LeatherLink (P) Ltd, Chennai - 600106 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP charset encoding
Hi all, I have problem storing the submitted data in the database in the right encoding. I need to use UTF-8 I need to save the Arabic text in UTF-8 encoding. I have a problem with UTF-8 and windows-1256 conversion. I wish I can understand those things, coz encoding thing will take my hair off When submitting a data from an HTML page and inserting them in MySQL: what encoding they will be ? is it the page encoding? the field size like VARCHAR 15 won't fit the same in both encoding for the same text. !! Is the font any relation with encoding? phpmyadmin doesn't support UTF-8 so dumping your data using it will screw it up is it a way to convert it inside the database... Explain to me please , or if you can tell me where to find my answers (not google) Nabil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP charset encoding
On Tue, Mar 30, 2004 at 11:23:03AM +0300, nabil wrote: Hi all, I have problem storing the submitted data in the database in the right encoding. I need to use UTF-8 I need to save the Arabic text in UTF-8 encoding. I have a problem with UTF-8 and windows-1256 conversion. I wish I can understand those things, coz encoding thing will take my hair off When submitting a data from an HTML page and inserting them in MySQL: what encoding they will be ? is it the page encoding? the field size like VARCHAR 15 won't fit the same in both encoding for the same text. !! Is the font any relation with encoding? phpmyadmin doesn't support UTF-8 so dumping your data using it will screw it up is it a way to convert it inside the database... Explain to me please , or if you can tell me where to find my answers (not google) if the page that the input form is on sets utf-8 as the content type, then most (?) browsers will send utf-8. you can use a meta tag like: meta http-equiv=Content-Type content=text/html; charset=utf-8 utf-8 characters are 8 bit clean, so they can be stored and retrieved in mysql 3.x ok, but proper utf-8 sorting etc. doesn't work. for many purposes though it seems to be ok. single characters in utf-8 encoding do look like multiple characters as far as 8 bit text handling programs are concerned (so yes, 15 characters in iso-8859-1 or ascii isn't the same length as 15 characters in utf-8). fonts that support utf-8 are required for properly displaying utf-8, and you have to specify utf-8 on the display page (either via a content-type header or with content-type meta tag as above) to get the browser to use the right fonts. - rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php