cp1257 nėra ASCII. Nereikia maišyti: ASCII ir 8-bit kodavimai, skirti vienai ar kitai lokalei, nėra tas pats.
Viskas gerai su tuo konvertavimu, kokį padarei...
<?
function hexdump($str) {
$n = strlen($str);
for ($i = 0; $i < $n; $i++) {
printf("%x ",ord($str[$i]));
}
}
echo hexdump(iconv("utf8", "cp1257", "Švara, ėra, įčįįėčę"));
?>
$ php a.php
d0 76 61 72 61 2c 20 eb 72 61 2c 20 e1 e8 e1 e1 eb e8 e6
$ python
Python 2.7.6 (default, Apr 9 2014, 11:48:52)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print '\xd0'.decode('cp1257')
Š