So, I tried to input cyrillic symbols to save them. I use fgets()
function to get symbols (actually symfony console uses it). The problem is I can't prevent random corrupting of symbols when I get them. To simplify, I made the next code:
$i=0;
while ($i !== 100) {
$i++;
$str = fgets(STDIN, 4096);
echo $str;
}
die;
I entered ТАйтл
, Некоторый текст
, Тайтл
. Always on a first or second entering I got this wrong symbols. Example of wrong symbols:
ðóððÉð╣Ðéð╗
(ТАйтл
).
I tried to play with mb_convert_encoding
, but generally, I always have UTF-8 encoding, so it's not about converting. But about in this case?
Many thanks for helping.