Page 1 of 1

Q:encoding practices...best solution

Posted: Tue Aug 02, 2005 3:37 am
by jmut
Hi,
PHP 4.4* and above
MySQL 4.0.*

As far as I understand if using UTF8 encoding we could represent pretty much any language.
My question is how should one set his or her application to have no encoding problems.
I guess there are two parts of the problem:
Data encoding when stored in the database
Data encodig when presented on the web (charset=........).
I have no idea as to what part PHP plays in this.

Why nowadays someone would want to use something different from UTF encoding - even if representing one language in the time(one never knows).

Could I set MySQL 4.0* to use store (not sure if needs actually) data in UTF and then present it.

If someone knows any good article on this issue - I have real trouble with multilanguage stuff - as far as I see stuff, everything should be UTF encoded - but how exactly to implement is another question.

Posted: Sun Aug 07, 2005 10:42 am
by jmut
Any comments on this....
I am sure there are some of you very familiar with multilingual sites...using UTF etc.

Posted: Sun Aug 07, 2005 1:46 pm
by timvw
You can use utf8_encode and utf8_encode for input and output of data in UTF-8.

If you are also using different encodings, iconv functions become handy. Or you can use the multibyte string extension.

And offcourse you need to use tell your users they are recieving utf-8

Code: Select all

<?php
header("Content-type: text/html; charset=utf-8");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
...