C
C
ChemAli2012-09-26 14:55:47
PHP
ChemAli, 2012-09-26 14:55:47

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

5 answer(s)
T
truekenny, 2012-09-26
@ChemAli

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;

T
tolyjan, 2012-09-27
@tolyjan

N
Nikolai Vasilchuk, 2012-09-27
@Anonym

<offtop>
преобразование «Ìàðèíà → Марина»

define('Ìàðèíà', 'Марина');

</offtop>

D
Dmitry, 2012-09-29
@DimaLondon

Sorry for offtopic.
A much more interesting transformation would be the "Valera → Marina" transformation.
With further use for its intended purpose xD

D
DigitallParts, 2017-02-19
@DigitalParts

echo iconv('cp1251','utf-8', iconv('',"latin1", 'Natural'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question