Page 1 of 1

ascii to decimal

Posted: Mon Mar 29, 2010 8:21 am
by scinor
Hi Everyone,

I have a value: �šš
which need to become: 0, 31, 22, -102, -102, 6

When is use ord

$code = "�šš";
echo(ord($code[0]));
echo(ord($code[1]));
echo(ord($code[2]));
echo(ord($code[3]));
echo(ord($code[4]));
echo(ord($code[5]));

The outcome = 0, 31, 22, 154, 154, 6

Could anyone help me out on this one?
The original code is in java and when using �šš it automaticly become's 0, 31, 22, -102, -102, 6 in a string.

Thanks in advance.

Re: ascii to decimal

Posted: Mon Mar 29, 2010 10:49 am
by omniuni
I think your problem may be in your character encoding. The character, whatever it is, is not displaying on my computer, which likely means that it is not utf-8.