Answer the question
In order to leave comments, you need to log in
Help me choose the conversion "Marina → Marina" with iconv+php
I can't figure out if the conversion from which encoding to which will give the result "Marina" at the output. One of the decoders claims that he did it by converting CP1252 → CP1251. In accordance with this hint, I write the code:
$text = 'Ìàðèíà';
echo iconv("windows-1252", "windows-1251", $text);
But the output is an empty string. Please help me solve this puzzle.
Answer the question
In order to leave comments, you need to log in
The file itself is utf-8 encoded
header('Content-type: text/plain; charset=windows-1251');
$text = 'Ìàðèíà';
$text = iconv("utf-8", "windows-1252", $text);
echo $text;
<offtop>
преобразование «Ìàðèíà → Марина»
define('Ìàðèíà', 'Марина');
Sorry for offtopic.
A much more interesting transformation would be the "Valera → Marina" transformation.
With further use for its intended purpose xD
echo iconv('cp1251','utf-8', iconv('',"latin1", 'Natural'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question