Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code Page 866 to CP1251
<?php
function cp866_to_cp1251($input)
{
$buffer = "";
for($i=0; $i<strlen($input); $i++)
{
if((ord($input[$i]) >= 128) && (ord($input[$i]) <= 191))
{
$buffer .= chr(ord($input[$i]) + 64);
} else {
$buffer .= $input[$i];
}
}
return $buffer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment