Jump to content

Archived

This topic is now archived and is closed to further replies.

wekkaw

Storing & Accessing Unicode Characteres

Recommended Posts

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:


[code]<?php
$tempArray = array('?','?','?','?','?','?','?','?');
?>[/code]

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.


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

my code goes here ....

?>
[/code]

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

week

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--quoteo(post=355007:date=Mar 14 2006, 02:12 PM:name=thx967)--][div class=\'quotetop\']QUOTE(thx967 @ Mar 14 2006, 02:12 PM) [snapback]355007[/snapback][/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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.