Re: languages and PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Your biggest problem will be if you accept any kind of user input which could be in any kind of language. Depending on your server configuration you'll probably have some serious cleaning and filtering to do.
I often have to employ this line for example:
foreach (array_keys($_POST) as $key) $clean[$key] = mb_convert_encoding($_POST[$key], "UTF-8");

Trying to make sure that you'll receive UTF-8 helps as well:
<form action="form.php" method="post" enctype="multipart/form-data" accept-charset="utf-8">

Magic-Quotes can be a mayor pain in the rear, especially if you're on a host where you can't turn them off.

Other than that I concur, keep everything in UTF-8, explicitly check everything you're not sure about for UTF-8 compliance and explicitly set all your database connections to use UTF-8 and store stuff in UTF-8.

Cheers.

UTF-8, UTF-8

On  27. Sep 2007, at 19:15, Angelo Zanetti wrote:

Hi all.

this is more of a general question but Im sure some people will have experience and also it will be useful to others who are looking for the same answers as I am.

What are the implications of having a site that has many different languages, including latin and non latin characters?

Firstly, can a mysql database handle these characters normally? or would you have to have a table for each language and set a different CHARSET for each language depending on the type of language?

Secondly, PHP and displaying the information: Is there anything that needs to change with regards to PHP and handling of these characters? OR is it able to handle all characters fine?

HTML: I assume the charset changes in the metatag in the <head> of the document?

Is there anything else that I might be missing or other problems that I should be aware of?

Thanks in advance.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux