Location: PHPKode > scripts > AfterLogic WebMail Lite PHP > afterlogic-webmail-lite-php/webmail/common/utf8encode/koi8-r.php
<?php

	/**
	 * Original data taken from:
	 * ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT
	 * @param string $string
	 * @return string
	 */
	function charset_encode_koi8_r($string)
	{
		$mapping = array(
					"\xE2\x94\x80" => "\x80",
					"\xE2\x94\x82" => "\x81",
					"\xE2\x94\x8C" => "\x82",
					"\xE2\x94\x90" => "\x83",
					"\xE2\x94\x94" => "\x84",
					"\xE2\x94\x98" => "\x85",
					"\xE2\x94\x9C" => "\x86",
					"\xE2\x94\xA4" => "\x87",
					"\xE2\x94\xAC" => "\x88",
					"\xE2\x94\xB4" => "\x89",
					"\xE2\x94\xBC" => "\x8A",
					"\xE2\x96\x80" => "\x8B",
					"\xE2\x96\x84" => "\x8C",
					"\xE2\x96\x88" => "\x8D",
					"\xE2\x96\x8C" => "\x8E",
					"\xE2\x96\x90" => "\x8F",
					"\xE2\x96\x91" => "\x90",
					"\xE2\x96\x92" => "\x91",
					"\xE2\x96\x93" => "\x92",
					"\xE2\x8C\xA0" => "\x93",
					"\xE2\x96\xA0" => "\x94",
					"\xE2\x88\x99" => "\x95",
					"\xE2\x88\x9A" => "\x96",
					"\xE2\x89\x88" => "\x97",
					"\xE2\x89\xA4" => "\x98",
					"\xE2\x89\xA5" => "\x99",
					"\xC2\xA0" => "\x9A",
					"\xE2\x8C\xA1" => "\x9B",
					"\xC2\xB0" => "\x9C",
					"\xC2\xB2" => "\x9D",
					"\xC2\xB7" => "\x9E",
					"\xC3\xB7" => "\x9F",
					"\xE2\x95\x90" => "\xA0",
					"\xE2\x95\x91" => "\xA1",
					"\xE2\x95\x92" => "\xA2",
					"\xD1\x91" => "\xA3",
					"\xE2\x95\x93" => "\xA4",
					"\xE2\x95\x94" => "\xA5",
					"\xE2\x95\x95" => "\xA6",
					"\xE2\x95\x96" => "\xA7",
					"\xE2\x95\x97" => "\xA8",
					"\xE2\x95\x98" => "\xA9",
					"\xE2\x95\x99" => "\xAA",
					"\xE2\x95\x9A" => "\xAB",
					"\xE2\x95\x9B" => "\xAC",
					"\xE2\x95\x9C" => "\xAD",
					"\xE2\x95\x9D" => "\xAE",
					"\xE2\x95\x9E" => "\xAF",
					"\xE2\x95\x9F" => "\xB0",
					"\xE2\x95\xA0" => "\xB1",
					"\xE2\x95\xA1" => "\xB2",
					"\xD0\x81" => "\xB3",
					"\xE2\x95\xA2" => "\xB4",
					"\xE2\x95\xA3" => "\xB5",
					"\xE2\x95\xA4" => "\xB6",
					"\xE2\x95\xA5" => "\xB7",
					"\xE2\x95\xA6" => "\xB8",
					"\xE2\x95\xA7" => "\xB9",
					"\xE2\x95\xA8" => "\xBA",
					"\xE2\x95\xA9" => "\xBB",
					"\xE2\x95\xAA" => "\xBC",
					"\xE2\x95\xAB" => "\xBD",
					"\xE2\x95\xAC" => "\xBE",
					"\xC2\xA9" => "\xBF",
					"\xD1\x8E" => "\xC0",
					"\xD0\xB0" => "\xC1",
					"\xD0\xB1" => "\xC2",
					"\xD1\x86" => "\xC3",
					"\xD0\xB4" => "\xC4",
					"\xD0\xB5" => "\xC5",
					"\xD1\x84" => "\xC6",
					"\xD0\xB3" => "\xC7",
					"\xD1\x85" => "\xC8",
					"\xD0\xB8" => "\xC9",
					"\xD0\xB9" => "\xCA",
					"\xD0\xBA" => "\xCB",
					"\xD0\xBB" => "\xCC",
					"\xD0\xBC" => "\xCD",
					"\xD0\xBD" => "\xCE",
					"\xD0\xBE" => "\xCF",
					"\xD0\xBF" => "\xD0",
					"\xD1\x8F" => "\xD1",
					"\xD1\x80" => "\xD2",
					"\xD1\x81" => "\xD3",
					"\xD1\x82" => "\xD4",
					"\xD1\x83" => "\xD5",
					"\xD0\xB6" => "\xD6",
					"\xD0\xB2" => "\xD7",
					"\xD1\x8C" => "\xD8",
					"\xD1\x8B" => "\xD9",
					"\xD0\xB7" => "\xDA",
					"\xD1\x88" => "\xDB",
					"\xD1\x8D" => "\xDC",
					"\xD1\x89" => "\xDD",
					"\xD1\x87" => "\xDE",
					"\xD1\x8A" => "\xDF",
					"\xD0\xAE" => "\xE0",
					"\xD0\x90" => "\xE1",
					"\xD0\x91" => "\xE2",
					"\xD0\xA6" => "\xE3",
					"\xD0\x94" => "\xE4",
					"\xD0\x95" => "\xE5",
					"\xD0\xA4" => "\xE6",
					"\xD0\x93" => "\xE7",
					"\xD0\xA5" => "\xE8",
					"\xD0\x98" => "\xE9",
					"\xD0\x99" => "\xEA",
					"\xD0\x9A" => "\xEB",
					"\xD0\x9B" => "\xEC",
					"\xD0\x9C" => "\xED",
					"\xD0\x9D" => "\xEE",
					"\xD0\x9E" => "\xEF",
					"\xD0\x9F" => "\xF0",
					"\xD0\xAF" => "\xF1",
					"\xD0\xA0" => "\xF2",
					"\xD0\xA1" => "\xF3",
					"\xD0\xA2" => "\xF4",
					"\xD0\xA3" => "\xF5",
					"\xD0\x96" => "\xF6",
					"\xD0\x92" => "\xF7",
					"\xD0\xAC" => "\xF8",
					"\xD0\xAB" => "\xF9",
					"\xD0\x97" => "\xFA",
					"\xD0\xA8" => "\xFB",
					"\xD0\xAD" => "\xFC",
					"\xD0\xA9" => "\xFD",
					"\xD0\xA7" => "\xFE",
					"\xD0\xAA" => "\xFF");

		return str_replace(array_keys($mapping), array_values($mapping), $string);
	}
Return current item: AfterLogic WebMail Lite PHP