Skip to content

Instantly share code, notes, and snippets.

@Max-Might Max-Might/gist:9639797
Last active Aug 29, 2015

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.