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

Page not Loading After Test
Hey All

It seemed that an inlcude statement wasn't working for some reason, so I tried a more

get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i

Sql and php order list script problems
Hi im having a few problems with trying to get the coding right on a orders list ive done (or trying

how to easy edit text, with box? Help.
Hi.
I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy

Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,

I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.

CALL FUNCT

Problems with adding a link to one position in a 'foreach' loop, please help
Hello!

Iam pretty new to programming and I wanna create a table with users from an array. It

DELETE rows based on content
I have a link in my rows

$bit="http://bit.ly/abcd";
$query = mysql_query("D

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

Linkage between two scripts
Okay say I have this for a link in a script:

Code: <li><a href="#&q

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