ISAPI_Rewrite 3.0 中文变乱码的解决方法
[ 2013-08-30 21:31:20 | 作者: admin ]
以前使用ISAPI_Rewrite 2.x中传输中文需要进行UrlEncode编码即可。
现在换用了 ISAPI_Rewrite 3.x 发现编码后的字符会变成乱码,如果直接使用中文不编码,则会被格式化为GBK字符串。
翻了手册,发现有一个配置参数可以解决该问题:
nounicode|NU
If NU flag is set, transformation from Unicode to UTF-8 will not take place and all Unicode characters remain encoded in %xx format.
在你的RewriteRule 规则后台添加 NU 即可恢复正常。
关于ISAPI_Rewrite中文变乱码解决方法,无论何种情况,统一解决思想:
1、在传输URL时,将中文进行urlencode,这样是没错的。
2、如果是ISAPI_Rewrite 3.x 只需添加 NU 参数即可。
配置举例:
传递的URL地址:
http://www.52news.com/search-%C6%BB%B9%FB.html
相应的RewriteRule:
最后,
无论使用哪家的产品,多看看产品手册是没错的,一般问题与使用方法在手册中都有完整的讲解。比如这次的 ISAPI_Rewrite 就是一个很好的说明。
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=2118
现在换用了 ISAPI_Rewrite 3.x 发现编码后的字符会变成乱码,如果直接使用中文不编码,则会被格式化为GBK字符串。
翻了手册,发现有一个配置参数可以解决该问题:
nounicode|NU
If NU flag is set, transformation from Unicode to UTF-8 will not take place and all Unicode characters remain encoded in %xx format.
在你的RewriteRule 规则后台添加 NU 即可恢复正常。
关于ISAPI_Rewrite中文变乱码解决方法,无论何种情况,统一解决思想:
1、在传输URL时,将中文进行urlencode,这样是没错的。
2、如果是ISAPI_Rewrite 3.x 只需添加 NU 参数即可。
配置举例:
传递的URL地址:
http://www.52news.com/search-%C6%BB%B9%FB.html
相应的RewriteRule:
RewriteRule ^/search-(.*)\.html$ /search\.do\?keyword=$1 [QSA,NU,PT,L]
最后,
无论使用哪家的产品,多看看产品手册是没错的,一般问题与使用方法在手册中都有完整的讲解。比如这次的 ISAPI_Rewrite 就是一个很好的说明。

这篇日志没有评论。
此日志不可发表评论。