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

Why is this query failing?
Why is this not working?
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID

MySQL query problem
When I try to run the following piece of code, I get this error:
QuoteWarning: mysql_query(): sup

Referential Integrity problem when inserting into 2 tables at same time
Hello Everyone,

Im relativity new to PHP and MySQL and i have come up against a problem. i h

Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming

PHP error on MySQL insert
I'm sure it's the simplest of issues, but I can't recall why this isn't working.

Code: [Selec

When i am Canseling the Billing Document in VF11 I am getting Shortdump
Hi Experts

When i am Canseling the Billing Document in VF11 I am getting Shortdump.

Take info from one coloum and move to another
Hi all,

I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_

PHP / MySQL Associative Multidimensional Array:
Hello.

I have data in a MySQL Table that adheres to the below: (note, no index, could add if

start new row of pictures
on my site www.budstreasureauctions.com there is a featured auctions box that users will pay to get

upgrade from 4.7 to ECC 6.0
Hi all,
we are going to do an upgrade from R/3 4.7 to ECC 6.0. I need to know if i can find som

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