5

I have a PHP script that read string data from .xls file (via PHP Excel Reader). But some special characters it returns in unicode encoded format. For example, instead of "é" returns "\xe9".

Is there any way, in PHP 5.2, how decode string with "\x??" characters to clasic UTF-8?

Thanks.

2
  • You should look into php.net/iconv. Commented Sep 17, 2012 at 19:14
  • I know iconv. But what I should put into first parameter? $decoded = iconv(??, 'UTF-8', $string) Commented Sep 17, 2012 at 19:19

1 Answer 1

4

Just use utf8_encode()

Here is an example: http://codepad.org/62STmyAl

Sign up to request clarification or add additional context in comments.

1 Comment

It works, thank you! I tried utf8_decode(), and it doesn't work. But utf8_encode() does, I dont get it :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.