Skip to content

Instantly share code, notes, and snippets.

Avatar

Костадин Дамянов Max-Might

View GitHub Profile
@Max-Might
Max-Might / gist:9639797
Last active Aug 29, 2015
Code Page 866 to CP1251
View gist:9639797
<?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);