일부 다른 인코딩을 사용하는 보라 내가 나의 스크립트입니다, 이로 인해 문제가 베컴 결합할 수 있도록 노력하겠다.
하지만 나는 내가 하고 싶은 것이 아니라, 그들이 사용하는 인코딩입니다 변경하십시오 can& t # 39 의 결과를 엔코딜 변경하십시오 정보기술 (it) 을 사용하여 매개변수입니다 스크립트입니다 스크립트입니다 a, b).
그래서: php 에서 UTF-8 에서 문자열으로 변경하십시오 iso 88591 간단한 방법은 없나? 그러나 그들은 doesn& t # 39, 나는 utf_encode 및 _decode 바라볼 do what i want. # 39, t, 왜 모든 " doesn& 좁히어 렉시스트 utf2iso () 또는 이와 유사한 기능을 " -?
Have a look at 'iconv ()' 또는 'mb_convert_encoding ()'. 그냥 by the way. 왜 don& # 39, t 'utf8_encode ()' 및 'utf8_decode ()' 작동합니까 당신꺼에요?
>. - utf8_decode 와 문자열 변환 >. 함께 인코딩되지 iso 8859 1 문자 >. UTF-8 로 싱글바이트 iso 8859 1 >. >. - utf8_encode 충족되었으며 iso 8859 1 인코딩합니다 >. utf-8 로 구체화하십시오
그래서 본질적으로
$utf8 = 'ÄÖÜ'; // file must be UTF-8 encoded
$iso88591_1 = utf8_decode($utf8);
$iso88591_2 = iconv('UTF-8', 'ISO-8859-1', $utf8);
$iso88591_2 = mb_convert_encoding($utf8, 'ISO-8859-1', 'UTF-8');
$iso88591 = 'ÄÖÜ'; // file must be ISO-8859-1 encoded
$utf8_1 = utf8_encode($iso88591);
$utf8_2 = iconv('ISO-8859-1', 'UTF-8', $iso88591);
$utf8_2 = mb_convert_encoding($iso88591, 'UTF-8', 'ISO-8859-1');
모든 어떻게해야합니다 utf8_en/decode () ',' 와 '같은 특별한 확장명은 mb_convert_encoding ()' 와 '필요 없이 필요한 연장 / 기스트링 iconv ()' 를 필요로 하는 연장 / iconv.
첫째, 다른 사용하여 don& # 39, t) 를 나타낸다. 이 중, UTF-8 은 말해둘꼐요 엉망하지 계산이 전부 사용해야 합니다.
여러분의 의견을 iso 8859 1 가능성이 있지 않지만 무언가 (iso 8859 15 indows, 1252년). 그러나 (http://php.net/manual/function.iconv.php") 에서, a href = " < 변환하십시오 사용하여 > iconv< /a>;;;; ',' (http://php.net/function.mb-convert-encoding) 또는 <, a href = " " > mb_convert_encoding < /a>.;;;
그럼에도 불구하고 '' 대한 '와' utf8_decode utf8_encode iso 8859 1 노력해야 합니다. 잘 될 것이라고 할 수만 있다면, http://php.net/manual/function.convert-uuencode.php) 이 https://partner. microsoft. 파일 또는 < ";; a href = " > uuencoded< /a>; <;;;; (http://php.net/manual/function.base64-encode.php) 또는 a href = " " > base64< /a>. 예를 들어 있는 문자열 변환 실패하거나 익올때 예상치 못한 결과를 얻을 수 있습니다.
메타 태그에 헤드에게 설정되었습니다 있다
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
링크 http://www.i18nqa.com/debug/utf8-debug.html 재장착하려면 심볼에는 문자를 사용하여 운영까지도.
str_replace 사용할 것
$find = array('“', '’', '…', '—', '–', '‘', 'é', 'Â', '•', 'Ëœ', 'â€'); // en dash
$replace = array('“', '’', '…', '—', '–', '‘', 'é', '', '•', '˜', '”');
$content = str_replace($find, $replace, $content);
내가 많이 도움말에서는 방법을 사용하고 있다. 감사합니다!
내가 이 기능을 사용하여:
function formatcell($data, $num, $fill=" ") {
$data = trim($data);
$data=str_replace(chr(13),' ',$data);
$data=str_replace(chr(10),' ',$data);
// translate UTF8 to English characters
$data = iconv('UTF-8', 'ASCII//TRANSLIT', $data);
$data = preg_replace("/[\'\"\^\~\`]/i", '', $data);
// fill it up with spaces
for ($i = strlen($data); $i < $num; $i++) {
$data .= $fill;
}
// limit string to num characters
$data = substr($data, 0, $num);
return $data;
}
echo formatcell("YES UTF8 String Zürich", 25, 'x'); //YES UTF8 String Zürichxxx
echo formatcell("NON UTF8 String Zurich", 25, 'x'); //NON UTF8 String Zurichxxx
내 블로그 내 함수은 체크아웃하려고 http://www.unexpectedit.com/php/php-handling-non-english-characters-utf8
() '와' 사용 'html_entity_decode 사마렌티티스 ()'.
$html = html_entity_decode(htmlentities($html, ENT_QUOTES, 'UTF-8'), ENT_QUOTES , 'ISO-8859-1');
'형식' () 에 여러분의 의견을 사마렌티티스 UTF8 '와' () '로 다시' iso 8859 1 html_entity_decode '형식'.