D
D
Dmitry Afonchenko2014-03-06 21:55:15
PHP
Dmitry Afonchenko, 2014-03-06 21:55:15

How to fix weirdness in PHP chr() behavior?

The program must return a character using the code from the ASCII table. Up to 128 everything works fine, but after that it gives out questions � instead of symbols. I know that the problem is in the encoding, but I do not know how to solve it. Comrades, tell me, maybe there are some functions or plugins for PHP that allow you to get rid of this nonsense? Thanks in advance to everyone who will respond.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2014-03-06
@Indermove

This is normal behavior: there is no character with this code in UTF-8.
First, decide what result you want to get.

S
Sergey, 2014-03-06
Protko @Fesor

I advise you to pay attention to the comments when referring to the php documentation:
php.net/manual/en/function.chr.php#55978

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question