Re: Searching MySQL with Japanese chars

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

 



On Fri, Oct 17, 2008 at 8:22 AM, robert mena <robert.mena@xxxxxxxxx> wrote:
> Hi,
> I am developing my first application that will have to handle with japanese
> data stored in a MySQL database.  After digging a while it seems that I'd
> have to set all pieces (from the charset of the apache,  to the encoding of
> the templates and database fields) set to UTF-8.
>
> I'd like to know if there is something special that I have to be aware when
> doing searches.  I am not sure that this is more related to PHP or MySQL
> itself so before sending to them (MySQL list) I'd like to hear from you.
>
> Thanks.
>

Make sure your character collation is utf also as that is exactly what
it's for.  You might need to use something like mysql_set_charset().
You'll need something like this also:

header('Content-Type: text/html; charset=utf-8');

The reason I say this is because however you put your data in is how
you need to search on it.  So if you inject utf8 into a latin1 db
you're going to have a hard time in the future.  Other than that
everything else should just work fine.

-- 
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