jq的get傳參數(shù)在utf-8中亂碼問題的解決php版
更新時(shí)間:2008年07月23日 19:54:10 作者:
在php下用jquery傳參出現(xiàn)亂碼的解決方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
document.write(escape("哈哈")+"<br>");
document.write(unescape("%u54C8%u54C8")+"<br>");
document.write(encodeURIComponent("哈哈")+"<br>");
document.write(decodeURIComponent("%E5%93%88%E5%93%88")+"<br>");
</script>
</head>
<body>
<?php
echo urldecode("%E5%93%88%E5%93%88");
echo "<br>";
echo rawurldecode("%E5%93%88%E5%93%88");
echo "<br />";
echo utf8_decode("%E5%93%88%E5%93%88");
echo "<br />";
echo "%E5%93%88%E5%93%88";
echo "<br />";
echo $_GET['act'];
echo "<br />";
echo urlencode($_GET['act']);
?>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
document.write(escape("哈哈")+"<br>");
document.write(unescape("%u54C8%u54C8")+"<br>");
document.write(encodeURIComponent("哈哈")+"<br>");
document.write(decodeURIComponent("%E5%93%88%E5%93%88")+"<br>");
</script>
</head>
<body>
<?php
echo urldecode("%E5%93%88%E5%93%88");
echo "<br>";
echo rawurldecode("%E5%93%88%E5%93%88");
echo "<br />";
echo utf8_decode("%E5%93%88%E5%93%88");
echo "<br />";
echo "%E5%93%88%E5%93%88";
echo "<br />";
echo $_GET['act'];
echo "<br />";
echo urlencode($_GET['act']);
?>
</body>
</html>
您可能感興趣的文章:
- PHP iconv 解決utf-8和gb2312編碼轉(zhuǎn)換問題
- PHP亂碼問題,UTF-8亂碼常見問題小結(jié)
- php中utf-8編碼下用正則表達(dá)式如何匹配漢字
- php中隱形字符65279(utf-8的BOM頭)問題
- php中json_encode UTF-8中文亂碼的更好解決方法
- php utf-8轉(zhuǎn)unicode的函數(shù)
- PHP utf-8編碼問題,utf8編碼,數(shù)據(jù)庫亂碼,頁面顯示輸出亂碼
- php中文亂碼怎么辦如何讓瀏覽器自動(dòng)識別utf-8
- PHP 截取字符串函數(shù)整理(支持gb2312和utf-8)
- php UTF-8、Unicode和BOM問題
- PHP如何實(shí)現(xiàn)Unicode和Utf-8編碼相互轉(zhuǎn)換
- php smarty截取中文字符亂碼問題?gb2312/utf-8
- PHP 與 UTF-8 的最佳實(shí)踐詳細(xì)介紹
相關(guān)文章
php5.4傳引用時(shí)報(bào)錯(cuò)問題分析
這篇文章主要介紹了php5.4傳引用時(shí)報(bào)錯(cuò)問題,結(jié)合實(shí)例形式分析了php5.4傳引用時(shí)報(bào)錯(cuò)問題及解決方法,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2016-01-01
PHP版 漢字轉(zhuǎn)碼的實(shí)現(xiàn)詳解
本篇文章是對用php實(shí)現(xiàn)漢字轉(zhuǎn)碼進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06

