Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   Japanese Characters with PHP (https://thetfp.com/tfp/tilted-technology/100226-japanese-characters-php.html)

innovis 01-23-2006 09:32 PM

Japanese Characters with PHP
 
I've got a MySQL DB with Japanese characters in it, stored as UTF-8. How can I make PHP print them out as Japanese characters?

Rawb 01-24-2006 06:37 PM

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

In the <head> section of your HTML output should get you there.

There are also a bunch of functions in PHP that will output the correct stuff for date and number formatting, the key is to putenv('LC='.$their_locale);

Unfortunately, $their_locale is different on different OS's/distributions, so you'll have to figure it out on your own, but that should be a good start for you.

innovis 01-24-2006 07:54 PM

I got it to work... in Firefox.

In IE It displays them as ASCII characters. If I use VIEW SOURCE on the IE page, it shows them as Japanese characters....

www.tinkerslab.com/japanese.php

Rawb 01-24-2006 08:29 PM

Ahh. IE, the web developers nightmare.

Okay, try this instead, put it before you output ANY content.
header('Content-Type:','text/html; charset=UTF-8');

That should tell IE earlier on that you are going to feed it UTF-8, and that it should be expecting that.

innovis 01-25-2006 12:30 AM

Still a no go...

Put the header in the php


All times are GMT -8. The time now is 07:56 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76