Page 1 of 1

displaying foreign languages in PHP

Posted: Thu Apr 08, 2004 4:59 pm
by davidklonski
Hello

I am trying to display foreign languages in PHP.
The translations for all the words need to be stored in PHP files.

Can anyone tell me what sort of encoding I need to use?
Does PHP support unicode?
If not, how do I save the foreign languages in the files?

what sort of character set do I need to use in the generated HTML pages?

thanks in advance

Posted: Fri Apr 09, 2004 2:19 am
by Weirdan
  • PHP has unicode support via mb_* functions
  • Even if you don't use that functions, you can set the Content-type header to include the character set used (actualy, you must do it to be compliant with http standards).
So.. [php_man]header[/php_man], [php_man]mb_[/php_man], ftp://ftp.isi.edu/in-notes/rfc2616.txt

Posted: Fri Apr 09, 2004 4:37 am
by davidklonski
I am trying to do something like:

Code: Select all

<?php
$var1 = '<Japanse word>';
$var2 = '<French word>';
?>
where <Japanese word> is an actual word in Japanese and the same goes for the French word

is it possible?
Under what sort of encoding do I need to store the file?

If I will later print those variables, will the output be in Japanese and French?

thanks

Posted: Fri Apr 09, 2004 6:42 am
by kyokutan
for japanese i enabled the mbstring.lanaguage = japanese in my php.ini file and also changed the default header to UTF-8.

i'm able to work with japanese characters now... though i'm not sure about the french side of things.

cheers.