Jump to content


Photo

Storing & Accessing Unicode Characteres


  • Please log in to reply
2 replies to this topic

#1 wekkaw

wekkaw
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 14 March 2006 - 04:24 PM

Hi, I tried to store Unicode characters into an array and retrieve them, but all I'm getting is "?"s instead of the Unicode characters I put in the code.

I typed the Unicode characters in MS-Word and past the values into my PHP code as seen below:


<?php
$tempArray = array('?','?','?','?','?','?','?','?');
?>

As you can see the array converts the Unicode chars to "?". What should I do to store the actual Unicode chars? Btw, the Unicode chars I'm trying to store into the array are between U+1200 to U+1370F. I've also set the page charset to UTF-8.


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<?php

my code goes here ....

?>

I appreciate in advance for any help you can give me.

week

#2 thx967

thx967
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 14 March 2006 - 07:12 PM

I just finished translating a site from english to chinese and ran into a similar problem when my translator sent over his work in MS word. I suggest using note pad or a text editor other than ms word. you'll also need to make sure your database is set to handle utf code as well and your php pages are also encoded for it.

#3 wekkaw

wekkaw
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 14 March 2006 - 08:14 PM

[!--quoteo(post=355007:date=Mar 14 2006, 02:12 PM:name=thx967)--][div class=\'quotetop\']QUOTE(thx967 @ Mar 14 2006, 02:12 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I just finished translating a site from english to chinese and ran into a similar problem when my translator sent over his work in MS word. I suggest using note pad or a text editor other than ms word. you'll also need to make sure your database is set to handle utf code as well and your php pages are also encoded for it.
[/quote]


Thanks for your response thx967.

I found out that since PHP doesn't support unicode, if I store the unicode values into an array in HTML entities form and set my page charset to UTF-8, it works just fine. For example for unicode char U+1200 I would store '&#x1200;' .

Thanks again.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users