|
-
Mar 2nd, 2006, 02:53 PM
#1
Thread Starter
Frenzied Member
php Unicode
Hello, I would like my blog to be a Unicode enabled site. How am I going to do that? My blog is very simple, there are fields of EntryNum, Date, Title and Content in mysql database, but I want write some characters into my entry and save it to mysql, after that retrieve those characters and display on browser. Any thoughts?
-
Mar 2nd, 2006, 04:04 PM
#2
Re: php Unicode
 Originally Posted by vbbit
Hello, I would like my blog to be a Unicode enabled site. How am I going to do that? My blog is very simple, there are fields of EntryNum, Date, Title and Content in mysql database, but I want write some characters into my entry and save it to mysql, after that retrieve those characters and display on browser. Any thoughts?
Just send the encoding format from the PHP header function, the encoding meta tag does not work unless your a bot 
I know MysQL can store UTF-8 so you shoud be fine there also.
Cheers,
Ryan Jones
-
Mar 2nd, 2006, 05:05 PM
#3
Thread Starter
Frenzied Member
Re: php Unicode
What is encoding format from the PHP header function?
-
Mar 2nd, 2006, 05:09 PM
#4
Re: php Unicode
 Originally Posted by vbbit
What is encoding format from the PHP header function?
http://uk.php.net/header
Should help 
If you site is an XM spec. you can use something like this:
PHP Code:
<?php
header('Content-type: application/text-html');
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
Or the IE blocker 
PHP Code:
<?php
header('Content-type: application/xhtml+xml');
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
Cheers,
Ryan Jones
Last edited by john tindell; Mar 5th, 2006 at 07:35 AM.
Reason: Fixed PHP Tags
-
Mar 2nd, 2006, 05:20 PM
#5
Re: php Unicode
PHP doesn't support unicode by default. However, you can either compile Multi-Byte String support into PHP or do it your self:
http://www.randomchaos.com/documents...hp_and_unicode
-
Mar 2nd, 2006, 05:25 PM
#6
Re: php Unicode
 Originally Posted by visualAd
Wasn't the queston about MySQL support too? I know 4.1.1 suports it because our server supports it and thats what I have 
Cheers,
Ryan Jones
-
Mar 2nd, 2006, 05:32 PM
#7
Re: php Unicode
Yeah, the question was about MySql; but I assumed he might want to use PHP collect and display the information. 
Unicode characters below 255 display fine, however, characters with a higher value will be interpreted by PHP as two separate characters. The resulting output then gets scrambled.
-
Mar 4th, 2006, 09:32 PM
#8
Re: php Unicode
header('Content-type: application/text-html');
Um, it's "text/html" - "application/text-html" doesn't exist.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|