Jump to content

Storing & Accessing Unicode Characteres


wekkaw

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.