Home  >  Article  >  Backend Development  >  让人琢磨不透的编码有关问题.很少发帖

让人琢磨不透的编码有关问题.很少发帖

WBOY
WBOYOriginal
2016-06-13 13:47:53669browse

让人琢磨不透的编码问题.很少发帖
奇怪了,我apache + window 用url带中参数传递完成正常
测试服务器 linux+apache 用同一个脚本同一个url(带中文参数)传递,就出现乱码问题..
之后在测试服务器的目录下传入 .htaccess 写入AddDefaultCharset utf-8 于事无补..

我php和html页面的编码全统一了.都是utf-8 高手看看先.100分小意思.

------解决方案--------------------
用urlencode编码先,再用urldecode解码。
估计linux是英文版os。
------解决方案--------------------
不太懂 帮lz顶
------解决方案--------------------
改下linux的默认编码试试!
------解决方案--------------------
url?urlencode(params),再用urldecode解码。或者你发现urldecode根本不需要了。。 

------解决方案--------------------
在URL里面带中文参数传递要进行URL编码
a.php

PHP code

$name="测试";
$encodeName=urlencode($name);
echo "<a href="urldecode.php?name=%7B%24encodeName%7D">URL传递参数测试</a>";
<br><font color="#e78608">------解决方案--------------------</font><br>学习 <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn