Can't get the unicode character


Posted on 16th Feb 2014 07:03 pm by admin

I'm trying to get some text from various parts of a file. I have converted the file to hex (bin2hex) and I've got this:

64 72 e6 62 65 72 (without spaces)

I'm converting that back by:

Code: <?php
function hex2bin($h)
{
if (!is_string($h)) return null;
$r='';
for ($a=0; $a<strlen($h); $a+=2)
$r .= chr(hexdec($h{$a}.$h{($a+1)}));

return $r;
}
?>

It works fine, except for unicode characters. For example, the above hex is giving me:

dr�ber

While it must be:

dræber

How can I get the correct word?
Thanks

No comments posted yet

Your Answer:

Login to answer
219 Like 34 Dislike
Previous forums Next forums
Other forums

Array disappearing in foreach loop
Okay, I have this problem where an array will become undefined in a foreach loop.

Here is the

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

iMatch stored value with the current value in a loop
Hello,

I have a MySQL db were I store articles in.

I have a form to fill these article

socket makes browser hang...
I have a socket server, and I am having a problem at the moment...

A browser sends a http hea

Help with captcha script needed
Hello,

I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, f

AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called throug

Weird Problem with curl while sending data
I am facing a weird problem with sending data to a site via curl.

If i send the value by this

Problem with coding MySQL query
I'm having heaps of trouble getting one of my PHP/MySQL queries to work for some reason (and the fun

mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div

Developing Ajax-enabled ASP.Net applications for the iPhone
I would like to develop Ajax web applications using Visual Studio that are optimized for the iPhone.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash