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

TemplatePower & AJAX
Hi all,



I'm currently implementing some AJAX features in my PHP-framework (which is b

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

foreach iterator
Hi Guys
Does the foreach loop have an inbuilt iterator ?

Need help with basic sql
Hi,

I am using oracle 10g, and having some small doubts related to sql , here goes the si

Dealing with code in db query
I am dealing with C code and I need to make sure it is encoded some how to ensure its integrity and

Need Reporting Advice
My SQL server doesn't support MS SQL reporting services that comes with SQL Enterprise or Express. T

php problem?
I don't think I'm stupid, but maybe I am.

I am working on a sit for a friend I am try to put

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

Code Review - SQL and Insertion Attacks (Warning: Not for Newbs)
Hey guys,

Its been a while, I know. Use to love coming here to answer peoples questions, but

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

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