本文整理汇总了PHP中sq_is8bit函数的典型用法代码示例。如果您正苦于以下问题:PHP sq_is8bit函数的具体用法?PHP sq_is8bit怎么用?PHP sq_is8bit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sq_is8bit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: charset_decode_utf_8
/**
* Decode utf-8 strings
* @param string $string Encoded string
* @return string Decoded string
*/
function charset_decode_utf_8($string)
{
global $squirrelmail_language;
// Japanese translation uses mbstring function to read utf-8
if ($squirrelmail_language == 'ja_JP') {
return $string;
}
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'utf-8')) {
return $string;
}
// decode six byte unicode characters
/* (i think currently there is no such symbol)
$string = preg_replace("/([\374-\375])([\200-\277])([\200-\277])([\200-\277])([\200-\277])([\200-\277])/e",
"'&#'.((ord('\\1')-252)*1073741824+(ord('\\2')-200)*16777216+(ord('\\3')-200)*262144+(ord('\\4')-128)*4096+(ord('\\5')-128)*64+(ord('\\6')-128)).';'",
$string);
*/
// decode five byte unicode characters
/* (i think currently there is no such symbol)
$string = preg_replace("/([\370-\373])([\200-\277])([\200-\277])([\200-\277])([\200-\277])/e",
"'&#'.((ord('\\1')-248)*16777216+(ord('\\2')-200)*262144+(ord('\\3')-128)*4096+(ord('\\4')-128)*64+(ord('\\5')-128)).';'",
$string);
*/
// decode four byte unicode characters
$string = preg_replace("/([ð-÷])([€-¿])([€-¿])([€-¿])/e", "'&#'.((ord('\\1')-240)*262144+(ord('\\2')-128)*4096+(ord('\\3')-128)*64+(ord('\\4')-128)).';'", $string);
// decode three byte unicode characters
$string = preg_replace("/([à-ï])([€-¿])([€-¿])/e", "'&#'.((ord('\\1')-224)*4096+(ord('\\2')-128)*64+(ord('\\3')-128)).';'", $string);
// decode two byte unicode characters
$string = preg_replace("/([À-ß])([€-¿])/e", "'&#'.((ord('\\1')-192)*64+(ord('\\2')-128)).';'", $string);
// remove broken unicode
$string = preg_replace("/[€-Ÿ]| |[¡-ÿ]/", '?', $string);
return $string;
}
示例2: charset_decode_gb18030
/**
* Decode gb18030 encoded string
* @param string $string gb18030 string
* @param boolean $save_html don't html encode special characters if true
* @return string $string decoded string
*/
function charset_decode_gb18030($string, $save_html = false)
{
// global $aggressive_decoding;
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'gb18030')) {
return $string;
}
// this is CPU intensive task. Use recode functions if they are available.
if (function_exists('recode_string')) {
// if string is already sanitized, undo htmlspecial chars
if (!$save_html) {
$string = str_replace(array('"', '<', '>', '&'), array('"', '<', '>', '&'), $string);
}
$string = recode_string("gb18030..html", $string);
// if string sanitizing is not needed, undo htmlspecialchars applied by recode.
if ($save_html) {
$string = str_replace(array('"', '<', '>', '&'), array('"', '<', '>', '&'), $string);
}
return $string;
}
/*
* iconv does not support html target, but internal utf-8 decoding is faster
* than pure php implementation.
*/
if (function_exists('iconv') && file_exists(SM_PATH . 'functions/decode/utf_8.php')) {
include_once SM_PATH . 'functions/decode/utf_8.php';
$string = iconv('gb18030', 'utf-8', $string);
return charset_decode_utf_8($string);
}
// mbstring does not support gb18030
// pure php decoding is not implemented.
return $string;
}
示例3: charset_decode_euc_kr
/**
* Decode euc-kr encoded string
* @param string $string euc-kr string
* @param boolean $save_html don't html encode special characters if true
* @return string $string decoded string
*/
function charset_decode_euc_kr($string, $save_html = false)
{
// global $aggressive_decoding;
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'euc-kr')) {
return $string;
}
// this is CPU intensive task. Use recode functions if they are available.
if (function_exists('recode_string')) {
// if string is already sanitized, undo htmlspecial chars
if (!$save_html) {
$string = str_replace(array('"', '<', '>', '&'), array('"', '<', '>', '&'), $string);
}
$string = recode_string("euc-kr..html", $string);
// if string sanitizing is not needed, undo htmlspecialchars applied by recode.
if ($save_html) {
$string = str_replace(array('"', '<', '>', '&'), array('"', '<', '>', '&'), $string);
}
return $string;
}
/*
* iconv does not support html target, but internal utf-8 decoding is faster
* than pure php implementation.
*/
if (function_exists('iconv') && file_exists(SM_PATH . 'functions/decode/utf_8.php')) {
include_once SM_PATH . 'functions/decode/utf_8.php';
$string = iconv('euc-kr', 'utf-8', $string);
return charset_decode_utf_8($string);
}
// try mbstring
if (function_exists('mb_convert_encoding') && function_exists('sq_mb_list_encodings') && check_php_version(4, 3, 0) && in_array('euc-kr', sq_mb_list_encodings())) {
return mb_convert_encoding($string, 'HTML-ENTITIES', 'EUC-KR');
}
return $string;
}
示例4: charset_decode_iso_8859_7
/**
* Decode iso8859-7 encoded strings
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_iso_8859_7($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'iso-8859-7')) {
return $string;
}
$iso8859_7 = array(" " => ' ', "¡" => '‘', "¢" => '’', "£" => '£', "¦" => '¦', "§" => '§', "¨" => '¨', "©" => '©', "«" => '«', "¬" => '¬', "" => '­', "¯" => '―', "°" => '°', "±" => '±', "²" => '²', "³" => '³', "´" => '΄', "µ" => '΅', "¶" => 'Ά', "·" => '·', "¸" => 'Έ', "¹" => 'Ή', "º" => 'Ί', "»" => '»', "¼" => 'Ό', "½" => '½', "¾" => 'Ύ', "¿" => 'Ώ', "À" => 'ΐ', "Á" => 'Α', "Â" => 'Β', "Ã" => 'Γ', "Ä" => 'Δ', "Å" => 'Ε', "Æ" => 'Ζ', "Ç" => 'Η', "È" => 'Θ', "É" => 'Ι', "Ê" => 'Κ', "Ë" => 'Λ', "Ì" => 'Μ', "Í" => 'Ν', "Î" => 'Ξ', "Ï" => 'Ο', "Ð" => 'Π', "Ñ" => 'Ρ', "Ó" => 'Σ', "Ô" => 'Τ', "Õ" => 'Υ', "Ö" => 'Φ', "×" => 'Χ', "Ø" => 'Ψ', "Ù" => 'Ω', "Ú" => 'Ϊ', "Û" => 'Ϋ', "Ü" => 'ά', "Ý" => 'έ', "Þ" => 'ή', "ß" => 'ί', "à" => 'ΰ', "á" => 'α', "â" => 'β', "ã" => 'γ', "ä" => 'δ', "å" => 'ε', "æ" => 'ζ', "ç" => 'η', "è" => 'θ', "é" => 'ι', "ê" => 'κ', "ë" => 'λ', "ì" => 'μ', "í" => 'ν', "î" => 'ξ', "ï" => 'ο', "ð" => 'π', "ñ" => 'ρ', "ò" => 'ς', "ó" => 'σ', "ô" => 'τ', "õ" => 'υ', "ö" => 'φ', "÷" => 'χ', "ø" => 'ψ', "ù" => 'ω', "ú" => 'ϊ', "û" => 'ϋ', "ü" => 'ό', "ý" => 'ύ', "þ" => 'ώ');
$string = str_replace(array_keys($iso8859_7), array_values($iso8859_7), $string);
return $string;
}
示例5: charset_decode_iso_8859_8
/**
* Decode iso8859-8 encoded strings
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_iso_8859_8($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'iso-8859-8')) {
return $string;
}
$iso8859_8 = array(" " => ' ', "¢" => '¢', "£" => '£', "¤" => '¤', "¥" => '¥', "¦" => '¦', "§" => '§', "¨" => '¨', "©" => '©', "ª" => '×', "«" => '«', "¬" => '¬', "" => '­', "®" => '®', "¯" => '¯', "°" => '°', "±" => '±', "²" => '²', "³" => '³', "´" => '´', "µ" => 'µ', "¶" => '¶', "·" => '·', "¸" => '¸', "¹" => '¹', "º" => '÷', "»" => '»', "¼" => '¼', "½" => '½', "¾" => '¾', "ß" => '‗', "à" => 'א', "á" => 'ב', "â" => 'ג', "ã" => 'ד', "ä" => 'ה', "å" => 'ו', "æ" => 'ז', "ç" => 'ח', "è" => 'ט', "é" => 'י', "ê" => 'ך', "ë" => 'כ', "ì" => 'ל', "í" => 'ם', "î" => 'מ', "ï" => 'ן', "ð" => 'נ', "ñ" => 'ס', "ò" => 'ע', "ó" => 'ף', "ô" => 'פ', "õ" => 'ץ', "ö" => 'צ', "÷" => 'ק', "ø" => 'ר', "ù" => 'ש', "ú" => 'ת', "ý" => '‎', "þ" => '‏');
$string = str_replace(array_keys($iso8859_8), array_values($iso8859_8), $string);
return $string;
}
示例6: charset_decode_iso_8859_6
/**
* Decode iso8859-6 strings
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_iso_8859_6($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'iso-8859-6')) {
return $string;
}
$iso8859_6 = array(" " => ' ', "¤" => '¤', "¬" => '،', "" => '­', "»" => '؛', "¿" => '؟', "Á" => 'ء', "Â" => 'آ', "Ã" => 'أ', "Ä" => 'ؤ', "Å" => 'إ', "Æ" => 'ئ', "Ç" => 'ا', "È" => 'ب', "É" => 'ة', "Ê" => 'ت', "Ë" => 'ث', "Ì" => 'ج', "Í" => 'ح', "Î" => 'خ', "Ï" => 'د', "Ð" => 'ذ', "Ñ" => 'ر', "Ò" => 'ز', "Ó" => 'س', "Ô" => 'ش', "Õ" => 'ص', "Ö" => 'ض', "×" => 'ط', "Ø" => 'ظ', "Ù" => 'ع', "Ú" => 'غ', "à" => 'ـ', "á" => 'ف', "â" => 'ق', "ã" => 'ك', "ä" => 'ل', "å" => 'م', "æ" => 'ن', "ç" => 'ه', "è" => 'و', "é" => 'ى', "ê" => 'ي', "ë" => 'ً', "ì" => 'ٌ', "í" => 'ٍ', "î" => 'َ', "ï" => 'ُ', "ð" => 'ِ', "ñ" => 'ّ', "ò" => 'ْ');
$string = str_replace(array_keys($iso8859_6), array_values($iso8859_6), $string);
return $string;
}
示例7: charset_decode_cp1258
/**
* Decde a cp1258-encoded string
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_cp1258($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'windows-1258')) {
return $string;
}
$cp1258 = array("�" => '€', "�" => '�', "�" => '‚', "�" => 'ƒ', "�" => '„', "�" => '…', "�" => '†', "�" => '‡', "�" => 'ˆ', "�" => '‰', "�" => '�', "�" => '‹', "�" => 'Œ', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => '‘', "�" => '’', "�" => '“', "�" => '”', "�" => '•', "�" => '–', "�" => '—', "�" => '˜', "�" => '™', "�" => '�', "�" => '›', "�" => 'œ', "�" => '�', "�" => '�', "�" => 'Ÿ', "�" => ' ', "�" => '¡', "�" => '¢', "�" => '£', "�" => '¤', "�" => '¥', "�" => '¦', "�" => '§', "�" => '¨', "�" => '©', "�" => 'ª', "�" => '«', "�" => '¬', "�" => '­', "�" => '®', "�" => '¯', "�" => '°', "�" => '±', "�" => '²', "�" => '³', "�" => '´', "�" => 'µ', "�" => '¶', "�" => '·', "�" => '¸', "�" => '¹', "�" => 'º', "�" => '»', "�" => '¼', "�" => '½', "�" => '¾', "�" => '¿', "�" => 'À', "�" => 'Á', "�" => 'Â', "�" => 'Ă', "�" => 'Ä', "�" => 'Å', "�" => 'Æ', "�" => 'Ç', "�" => 'È', "�" => 'É', "�" => 'Ê', "�" => 'Ë', "�" => '̀', "�" => 'Í', "�" => 'Î', "�" => 'Ï', "�" => 'Đ', "�" => 'Ñ', "�" => '̉', "�" => 'Ó', "�" => 'Ô', "�" => 'Ơ', "�" => 'Ö', "�" => '×', "�" => 'Ø', "�" => 'Ù', "�" => 'Ú', "�" => 'Û', "�" => 'Ü', "�" => 'Ư', "�" => '̃', "�" => 'ß', "�" => 'à', "�" => 'á', "�" => 'â', "�" => 'ă', "�" => 'ä', "�" => 'å', "�" => 'æ', "�" => 'ç', "�" => 'è', "�" => 'é', "�" => 'ê', "�" => 'ë', "�" => '́', "�" => 'í', "�" => 'î', "�" => 'ï', "�" => 'đ', "�" => 'ñ', "�" => '̣', "�" => 'ó', "�" => 'ô', "�" => 'ơ', "�" => 'ö', "�" => '÷', "�" => 'ø', "�" => 'ù', "�" => 'ú', "�" => 'û', "�" => 'ü', "�" => 'ư', "�" => '₫', "�" => 'ÿ');
$string = str_replace(array_keys($cp1258), array_values($cp1258), $string);
return $string;
}
示例8: charset_decode_cp1251
/**
* Decode cp1251-encoded string
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_cp1251($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'windows-1251')) {
return $string;
}
$cp1251 = array("�" => 'Ђ', "�" => 'Ѓ', "�" => '‚', "�" => 'ѓ', "�" => '„', "�" => '…', "�" => '†', "�" => '‡', "�" => '€', "�" => '‰', "�" => 'Љ', "�" => '‹', "�" => 'Њ', "�" => 'Ќ', "�" => 'Ћ', "�" => 'Џ', "�" => 'ђ', "�" => '‘', "�" => '’', "�" => '“', "�" => '”', "�" => '•', "�" => '–', "�" => '—', "�" => '�', "�" => '™', "�" => 'љ', "�" => '›', "�" => 'њ', "�" => 'ќ', "�" => 'ћ', "�" => 'џ', "�" => ' ', "�" => 'Ў', "�" => 'ў', "�" => 'Ј', "�" => '¤', "�" => 'Ґ', "�" => '¦', "�" => '§', "�" => 'Ё', "�" => '©', "�" => 'Є', "�" => '«', "�" => '¬', "�" => '­', "�" => '®', "�" => 'Ї', "�" => '°', "�" => '±', "�" => 'І', "�" => 'і', "�" => 'ґ', "�" => 'µ', "�" => '¶', "�" => '·', "�" => 'ё', "�" => '№', "�" => 'є', "�" => '»', "�" => 'ј', "�" => 'Ѕ', "�" => 'ѕ', "�" => 'ї', "�" => 'А', "�" => 'Б', "�" => 'В', "�" => 'Г', "�" => 'Д', "�" => 'Е', "�" => 'Ж', "�" => 'З', "�" => 'И', "�" => 'Й', "�" => 'К', "�" => 'Л', "�" => 'М', "�" => 'Н', "�" => 'О', "�" => 'П', "�" => 'Р', "�" => 'С', "�" => 'Т', "�" => 'У', "�" => 'Ф', "�" => 'Х', "�" => 'Ц', "�" => 'Ч', "�" => 'Ш', "�" => 'Щ', "�" => 'Ъ', "�" => 'Ы', "�" => 'Ь', "�" => 'Э', "�" => 'Ю', "�" => 'Я', "�" => 'а', "�" => 'б', "�" => 'в', "�" => 'г', "�" => 'д', "�" => 'е', "�" => 'ж', "�" => 'з', "�" => 'и', "�" => 'й', "�" => 'к', "�" => 'л', "�" => 'м', "�" => 'н', "�" => 'о', "�" => 'п', "�" => 'р', "�" => 'с', "�" => 'т', "�" => 'у', "�" => 'ф', "�" => 'х', "�" => 'ц', "�" => 'ч', "�" => 'ш', "�" => 'щ', "�" => 'ъ', "�" => 'ы', "�" => 'ь', "�" => 'э', "�" => 'ю', "�" => 'я');
$string = str_replace(array_keys($cp1251), array_values($cp1251), $string);
return $string;
}
示例9: charset_decode_iso_8859_11
/**
* Decode iso8859-11 string
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_iso_8859_11($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'iso-8859-11')) {
return $string;
}
$iso8859_11 = array(" " => ' ', "¡" => 'ก', "¢" => 'ข', "£" => 'ฃ', "¤" => 'ค', "¥" => 'ฅ', "¦" => 'ฆ', "§" => 'ง', "¨" => 'จ', "©" => 'ฉ', "ª" => 'ช', "«" => 'ซ', "¬" => 'ฌ', "" => 'ญ', "®" => 'ฎ', "¯" => 'ฏ', "°" => 'ฐ', "±" => 'ฑ', "²" => 'ฒ', "³" => 'ณ', "´" => 'ด', "µ" => 'ต', "¶" => 'ถ', "·" => 'ท', "¸" => 'ธ', "¹" => 'น', "º" => 'บ', "»" => 'ป', "¼" => 'ผ', "½" => 'ฝ', "¾" => 'พ', "¿" => 'ฟ', "À" => 'ภ', "Á" => 'ม', "Â" => 'ย', "Ã" => 'ร', "Ä" => 'ฤ', "Å" => 'ล', "Æ" => 'ฦ', "Ç" => 'ว', "È" => 'ศ', "É" => 'ษ', "Ê" => 'ส', "Ë" => 'ห', "Ì" => 'ฬ', "Í" => 'อ', "Î" => 'ฮ', "Ï" => 'ฯ', "Ð" => 'ะ', "Ñ" => 'ั', "Ò" => 'า', "Ó" => 'ำ', "Ô" => 'ิ', "Õ" => 'ี', "Ö" => 'ึ', "×" => 'ื', "Ø" => 'ุ', "Ù" => 'ู', "Ú" => 'ฺ', "ß" => '฿', "à" => 'เ', "á" => 'แ', "â" => 'โ', "ã" => 'ใ', "ä" => 'ไ', "å" => 'ๅ', "æ" => 'ๆ', "ç" => '็', "è" => '่', "é" => '้', "ê" => '๊', "ë" => '๋', "ì" => '์', "í" => 'ํ', "î" => '๎', "ï" => '๏', "ð" => '๐', "ñ" => '๑', "ò" => '๒', "ó" => '๓', "ô" => '๔', "õ" => '๕', "ö" => '๖', "÷" => '๗', "ø" => '๘', "ù" => '๙', "ú" => '๚', "û" => '๛');
$string = str_replace(array_keys($iso8859_11), array_values($iso8859_11), $string);
return $string;
}
示例10: charset_decode_cp1253
/**
* Decode cp1253-encoded string
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_cp1253($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'windows-1253')) {
return $string;
}
$cp1253 = array("�" => '€', "�" => '�', "�" => '‚', "�" => 'ƒ', "�" => '„', "�" => '…', "�" => '†', "�" => '‡', "�" => '�', "�" => '‰', "�" => '�', "�" => '‹', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => '‘', "�" => '’', "�" => '“', "�" => '”', "�" => '•', "�" => '–', "�" => '—', "�" => '�', "�" => '™', "�" => '�', "�" => '›', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => ' ', "�" => '΅', "�" => 'Ά', "�" => '£', "�" => '¤', "�" => '¥', "�" => '¦', "�" => '§', "�" => '¨', "�" => '©', "�" => '�', "�" => '«', "�" => '¬', "�" => '­', "�" => '®', "�" => '―', "�" => '°', "�" => '±', "�" => '²', "�" => '³', "�" => '΄', "�" => 'µ', "�" => '¶', "�" => '·', "�" => 'Έ', "�" => 'Ή', "�" => 'Ί', "�" => '»', "�" => 'Ό', "�" => '½', "�" => 'Ύ', "�" => 'Ώ', "�" => 'ΐ', "�" => 'Α', "�" => 'Β', "�" => 'Γ', "�" => 'Δ', "�" => 'Ε', "�" => 'Ζ', "�" => 'Η', "�" => 'Θ', "�" => 'Ι', "�" => 'Κ', "�" => 'Λ', "�" => 'Μ', "�" => 'Ν', "�" => 'Ξ', "�" => 'Ο', "�" => 'Π', "�" => 'Ρ', "�" => '�', "�" => 'Σ', "�" => 'Τ', "�" => 'Υ', "�" => 'Φ', "�" => 'Χ', "�" => 'Ψ', "�" => 'Ω', "�" => 'Ϊ', "�" => 'Ϋ', "�" => 'ά', "�" => 'έ', "�" => 'ή', "�" => 'ί', "�" => 'ΰ', "�" => 'α', "�" => 'β', "�" => 'γ', "�" => 'δ', "�" => 'ε', "�" => 'ζ', "�" => 'η', "�" => 'θ', "�" => 'ι', "�" => 'κ', "�" => 'λ', "�" => 'μ', "�" => 'ν', "�" => 'ξ', "�" => 'ο', "�" => 'π', "�" => 'ρ', "�" => 'ς', "�" => 'σ', "�" => 'τ', "�" => 'υ', "�" => 'φ', "�" => 'χ', "�" => 'ψ', "�" => 'ω', "�" => 'ϊ', "�" => 'ϋ', "�" => 'ό', "�" => 'ύ', "�" => 'ώ', "�" => '�');
$string = str_replace(array_keys($cp1253), array_values($cp1253), $string);
return $string;
}
示例11: charset_decode_iso_8859_13
/**
* Decode iso8859-13
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_iso_8859_13($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'iso-8859-13')) {
return $string;
}
$iso8859_13 = array(" " => ' ', "¡" => '”', "¢" => '¢', "£" => '£', "¤" => '¤', "¥" => '„', "¦" => '¦', "§" => '§', "¨" => 'Ø', "©" => '©', "ª" => 'Ŗ', "«" => '«', "¬" => '¬', "" => '­', "®" => '®', "¯" => 'Æ', "°" => '°', "±" => '±', "²" => '²', "³" => '³', "´" => '“', "µ" => 'µ', "¶" => '¶', "·" => '·', "¸" => 'ø', "¹" => '¹', "º" => 'ŗ', "»" => '»', "¼" => '¼', "½" => '½', "¾" => '¾', "¿" => 'æ', "À" => 'Ą', "Á" => 'Į', "Â" => 'Ā', "Ã" => 'Ć', "Ä" => 'Ä', "Å" => 'Å', "Æ" => 'Ę', "Ç" => 'Ē', "È" => 'Č', "É" => 'É', "Ê" => 'Ź', "Ë" => 'Ė', "Ì" => 'Ģ', "Í" => 'Ķ', "Î" => 'Ī', "Ï" => 'Ļ', "Ð" => 'Š', "Ñ" => 'Ń', "Ò" => 'Ņ', "Ó" => 'Ó', "Ô" => 'Ō', "Õ" => 'Õ', "Ö" => 'Ö', "×" => '×', "Ø" => 'Ų', "Ù" => 'Ł', "Ú" => 'Ś', "Û" => 'Ū', "Ü" => 'Ü', "Ý" => 'Ż', "Þ" => 'Ž', "ß" => 'ß', "à" => 'ą', "á" => 'į', "â" => 'ā', "ã" => 'ć', "ä" => 'ä', "å" => 'å', "æ" => 'ę', "ç" => 'ē', "è" => 'č', "é" => 'é', "ê" => 'ź', "ë" => 'ė', "ì" => 'ģ', "í" => 'ķ', "î" => 'ī', "ï" => 'ļ', "ð" => 'š', "ñ" => 'ń', "ò" => 'ņ', "ó" => 'ó', "ô" => 'ō', "õ" => 'õ', "ö" => 'ö', "÷" => '÷', "ø" => 'ų', "ù" => 'ł', "ú" => 'ś', "û" => 'ū', "ü" => 'ü', "ý" => 'ż', "þ" => 'ž', "ÿ" => '’');
$string = str_replace(array_keys($iso8859_13), array_values($iso8859_13), $string);
return $string;
}
示例12: charset_decode_iso_ir_111
/**
* Decode iso-ir-111 encoded strings
* @param string $string Encoded string
* @return string Decoded string
*/
function charset_decode_iso_ir_111($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'iso-ir-111')) {
return $string;
}
$iso_ir_111 = array(" " => ' ', "¡" => 'ђ', "¢" => 'ѓ', "£" => 'ё', "¤" => 'є', "¥" => 'ѕ', "¦" => 'і', "§" => 'ї', "¨" => 'ј', "©" => 'љ', "ª" => 'њ', "«" => 'ћ', "¬" => 'ќ', "" => '­', "®" => 'ў', "¯" => 'џ', "°" => '№', "±" => 'Ђ', "²" => 'Ѓ', "³" => 'Ё', "´" => 'Є', "µ" => 'Ѕ', "¶" => 'І', "·" => 'Ї', "¸" => 'Ј', "¹" => 'Љ', "º" => 'Њ', "»" => 'Ћ', "¼" => 'Ќ', "½" => '¤', "¾" => 'Ў', "¿" => 'Џ', "À" => 'ю', "Á" => 'а', "Â" => 'б', "Ã" => 'ц', "Ä" => 'д', "Å" => 'е', "Æ" => 'ф', "Ç" => 'г', "È" => 'х', "É" => 'и', "Ê" => 'й', "Ë" => 'к', "Ì" => 'л', "Í" => 'м', "Î" => 'н', "Ï" => 'о', "Ð" => 'п', "Ñ" => 'я', "Ò" => 'р', "Ó" => 'с', "Ô" => 'т', "Õ" => 'у', "Ö" => 'ж', "×" => 'в', "Ø" => 'ь', "Ù" => 'ы', "Ú" => 'з', "Û" => 'ш', "Ü" => 'э', "Ý" => 'щ', "Þ" => 'ч', "ß" => 'ъ', "à" => 'Ю', "á" => 'А', "â" => 'Б', "ã" => 'Ц', "ä" => 'Д', "å" => 'Е', "æ" => 'Ф', "ç" => 'Г', "è" => 'Х', "é" => 'И', "ê" => 'Й', "ë" => 'К', "ì" => 'Л', "í" => 'М', "î" => 'Н', "ï" => 'О', "ð" => 'П', "ñ" => 'Я', "ò" => 'Р', "ó" => 'С', "ô" => 'Т', "õ" => 'У', "ö" => 'Ж', "÷" => 'В', "ø" => 'Ь', "ù" => 'Ы', "ú" => 'З', "û" => 'Ш', "ü" => 'Э', "ý" => 'Щ', "þ" => 'Ч', "ÿ" => 'Ъ');
$string = str_replace(array_keys($iso_ir_111), array_values($iso_ir_111), $string);
return $string;
}
示例13: charset_decode_cp855
/**
* Decode a cp855-encoded string
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_cp855($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'ibm855')) {
return $string;
}
$cp855 = array("�" => 'ђ', "�" => 'Ђ', "�" => 'ѓ', "�" => 'Ѓ', "�" => 'ё', "�" => 'Ё', "�" => 'є', "�" => 'Є', "�" => 'ѕ', "�" => 'Ѕ', "�" => 'і', "�" => 'І', "�" => 'ї', "�" => 'Ї', "�" => 'ј', "�" => 'Ј', "�" => 'љ', "�" => 'Љ', "�" => 'њ', "�" => 'Њ', "�" => 'ћ', "�" => 'Ћ', "�" => 'ќ', "�" => 'Ќ', "�" => 'ў', "�" => 'Ў', "�" => 'џ', "�" => 'Џ', "�" => 'ю', "�" => 'Ю', "�" => 'ъ', "�" => 'Ъ', "�" => 'а', "�" => 'А', "�" => 'б', "�" => 'Б', "�" => 'ц', "�" => 'Ц', "�" => 'д', "�" => 'Д', "�" => 'е', "�" => 'Е', "�" => 'ф', "�" => 'Ф', "�" => 'г', "�" => 'Г', "�" => '«', "�" => '»', "�" => '░', "�" => '▒', "�" => '▓', "�" => '│', "�" => '┤', "�" => 'х', "�" => 'Х', "�" => 'и', "�" => 'И', "�" => '╣', "�" => '║', "�" => '╗', "�" => '╝', "�" => 'й', "�" => 'Й', "�" => '┐', "�" => '└', "�" => '┴', "�" => '┬', "�" => '├', "�" => '─', "�" => '┼', "�" => 'к', "�" => 'К', "�" => '╚', "�" => '╔', "�" => '╩', "�" => '╦', "�" => '╠', "�" => '═', "�" => '╬', "�" => '¤', "�" => 'л', "�" => 'Л', "�" => 'м', "�" => 'М', "�" => 'н', "�" => 'Н', "�" => 'о', "�" => 'О', "�" => 'п', "�" => '┘', "�" => '┌', "�" => '█', "�" => '▄', "�" => 'П', "�" => 'я', "�" => '▀', "�" => 'Я', "�" => 'р', "�" => 'Р', "�" => 'с', "�" => 'С', "�" => 'т', "�" => 'Т', "�" => 'у', "�" => 'У', "�" => 'ж', "�" => 'Ж', "�" => 'в', "�" => 'В', "�" => 'ь', "�" => 'Ь', "�" => '№', "�" => '­', "�" => 'ы', "�" => 'Ы', "�" => 'з', "�" => 'З', "�" => 'ш', "�" => 'Ш', "�" => 'э', "�" => 'Э', "�" => 'щ', "�" => 'Щ', "�" => 'ч', "�" => 'Ч', "�" => '§', "�" => '■', "�" => ' ');
$string = str_replace(array_keys($cp855), array_values($cp855), $string);
return $string;
}
示例14: charset_decode_iso_8859_15
/**
* Decode iso8859-15 encoded string
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_iso_8859_15($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'iso-8859-15')) {
return $string;
}
$iso8859_15 = array(" " => ' ', "¡" => '¡', "¢" => '¢', "£" => '£', "¤" => '€', "¥" => '¥', "¦" => 'Š', "§" => '§', "¨" => 'š', "©" => '©', "ª" => 'ª', "«" => '«', "¬" => '¬', "" => '­', "®" => '®', "¯" => '¯', "°" => '°', "±" => '±', "²" => '²', "³" => '³', "´" => 'Ž', "µ" => 'µ', "¶" => '¶', "·" => '·', "¸" => 'ž', "¹" => '¹', "º" => 'º', "»" => '»', "¼" => 'Œ', "½" => 'œ', "¾" => 'Ÿ', "¿" => '¿', "À" => 'À', "Á" => 'Á', "Â" => 'Â', "Ã" => 'Ã', "Ä" => 'Ä', "Å" => 'Å', "Æ" => 'Æ', "Ç" => 'Ç', "È" => 'È', "É" => 'É', "Ê" => 'Ê', "Ë" => 'Ë', "Ì" => 'Ì', "Í" => 'Í', "Î" => 'Î', "Ï" => 'Ï', "Ð" => 'Ð', "Ñ" => 'Ñ', "Ò" => 'Ò', "Ó" => 'Ó', "Ô" => 'Ô', "Õ" => 'Õ', "Ö" => 'Ö', "×" => '×', "Ø" => 'Ø', "Ù" => 'Ù', "Ú" => 'Ú', "Û" => 'Û', "Ü" => 'Ü', "Ý" => 'Ý', "Þ" => 'Þ', "ß" => 'ß', "à" => 'à', "á" => 'á', "â" => 'â', "ã" => 'ã', "ä" => 'ä', "å" => 'å', "æ" => 'æ', "ç" => 'ç', "è" => 'è', "é" => 'é', "ê" => 'ê', "ë" => 'ë', "ì" => 'ì', "í" => 'í', "î" => 'î', "ï" => 'ï', "ð" => 'ð', "ñ" => 'ñ', "ò" => 'ò', "ó" => 'ó', "ô" => 'ô', "õ" => 'õ', "ö" => 'ö', "÷" => '÷', "ø" => 'ø', "ù" => 'ù', "ú" => 'ú', "û" => 'û', "ü" => 'ü', "ý" => 'ý', "þ" => 'þ', "ÿ" => 'ÿ');
$string = str_replace(array_keys($iso8859_15), array_values($iso8859_15), $string);
return $string;
}
示例15: charset_decode_cp1255
/**
* Decode cp1255-encoded string
* @param string $string Encoded string
* @return string $string decoded string
*/
function charset_decode_cp1255($string)
{
// don't do decoding when there are no 8bit symbols
if (!sq_is8bit($string, 'windows-1255')) {
return $string;
}
$cp1255 = array("�" => '€', "�" => '�', "�" => '‚', "�" => 'ƒ', "�" => '„', "�" => '…', "�" => '†', "�" => '‡', "�" => 'ˆ', "�" => '‰', "�" => '�', "�" => '‹', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => '‘', "�" => '’', "�" => '“', "�" => '”', "�" => '•', "�" => '–', "�" => '—', "�" => '˜', "�" => '™', "�" => '�', "�" => '›', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => ' ', "�" => '¡', "�" => '¢', "�" => '£', "�" => '₪', "�" => '¥', "�" => '¦', "�" => '§', "�" => '¨', "�" => '©', "�" => '×', "�" => '«', "�" => '¬', "�" => '­', "�" => '®', "�" => '¯', "�" => '°', "�" => '±', "�" => '²', "�" => '³', "�" => '´', "�" => 'µ', "�" => '¶', "�" => '·', "�" => '¸', "�" => '¹', "�" => '÷', "�" => '»', "�" => '¼', "�" => '½', "�" => '¾', "�" => '¿', "�" => 'ְ', "�" => 'ֱ', "�" => 'ֲ', "�" => 'ֳ', "�" => 'ִ', "�" => 'ֵ', "�" => 'ֶ', "�" => 'ַ', "�" => 'ָ', "�" => 'ֹ', "�" => '�', "�" => 'ֻ', "�" => 'ּ', "�" => 'ֽ', "�" => '־', "�" => 'ֿ', "�" => '׀', "�" => 'ׁ', "�" => 'ׂ', "�" => '׃', "�" => 'װ', "�" => 'ױ', "�" => 'ײ', "�" => '׳', "�" => '״', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => '�', "�" => 'א', "�" => 'ב', "�" => 'ג', "�" => 'ד', "�" => 'ה', "�" => 'ו', "�" => 'ז', "�" => 'ח', "�" => 'ט', "�" => 'י', "�" => 'ך', "�" => 'כ', "�" => 'ל', "�" => 'ם', "�" => 'מ', "�" => 'ן', "�" => 'נ', "�" => 'ס', "�" => 'ע', "�" => 'ף', "�" => 'פ', "�" => 'ץ', "�" => 'צ', "�" => 'ק', "�" => 'ר', "�" => 'ש', "�" => 'ת', "�" => '�', "�" => '�', "�" => '‎', "�" => '‏', "�" => '�');
$string = str_replace(array_keys($cp1255), array_values($cp1255), $string);
return $string;
}