Tilted Forum Project Discussion Community

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology
New! Use your Facebook, Google, AIM & Yahoo accounts to securely log into this site, click logo to login  
Register Register Blogs Members List Mark Forums Read

Reply
 
LinkBack Thread Tools
Old 01-23-2006, 09:32 PM   #1 (permalink)
Crazy
 
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?
innovis is offline   Reply With Quote
Old 01-24-2006, 06:37 PM   #2 (permalink)
Crazy
 
Location: Salt Town, UT
<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.
Rawb is offline   Reply With Quote
Old 01-24-2006, 07:54 PM   #3 (permalink)
Crazy
 
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
innovis is offline   Reply With Quote
Old 01-24-2006, 08:29 PM   #4 (permalink)
Crazy
 
Location: Salt Town, UT
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.
Rawb is offline   Reply With Quote
Old 01-25-2006, 12:30 AM   #5 (permalink)
Crazy
 
Still a no go...

Put the header in the php
innovis is offline   Reply With Quote
Reply

Bookmarks

Tags
characters, japanese, php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 05:54 PM.

Contact Us - Tilted Forum Project - Archive - Top

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
All text © 2002-2009 Tilted Forum Project
"Insignia" vBulletin 3.5 - b6gm6n - x7x7x7.com