<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>深度VPS &#187; liunx</title>
	<atom:link href="http://www.deepvps.com/tag/liunx/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>解决liunx下不支持中文的问题</title>
		<link>http://www.deepvps.com/support-chinese-in-liunx.html</link>
		<comments>http://www.deepvps.com/support-chinese-in-liunx.html#comments</comments>
		<pubDate>Wed, 18 Apr 2012 02:17:12 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[liunx]]></category>
		<category><![CDATA[中文]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=1101</guid>
		<description><![CDATA[在IE下默认是以UTF-8的方式编码URL，向服务器发送请求，当中文出现在URL中的时候，就会被以UTF-8的方式编码，发送向服务器。这个时候服务器的字符集就会影响到WEB对URL的解码。
很多时候在其实不论是NGINX还是APACHE，问题的本质在于浏览器端请求的字符集和服务器端的字符集是否一致，当出现不一致的时候，服务器就无法找到请求的路径，从而出现404  NOT FOUND的错误。解决方案可以从以下几方面开始：
1、服务器的系统字符集
在centos下可以用echo  $LANG查看。可以在vi /etc/profile 中增加
export zh_CN.utf-8
export  LANG=zh_CN.utf-8
然后重新启动服务器，即可生效
2、nginx的conf文件中配置的字符集
在/www/wdlinux/nginx/conf/nginx.conf中的charset设置。
3、被请求的文件路径或者文件名的字符集。
第1和第2点更改很容易，第3点，更改文件名的字符集，需要使用工具convmv才能完成
convmv  可以从http://j3e.de/linux/convmv 下载，
wget http://j3e.de/linux/convmv/convmv-1.14.tar.gz
tar  -zxvf convmv-1.14.tar.gz
cd convmv-1.14
make  clean;
make install;
如：
./convmv -f GB2312 -t UTF-8  -r &#8211;nosmart &#8211;notest userfiles/*.*
以上表示  userfiles下的所有文件的文件名由GB2312转换为UTF-8
对于文件内容的字符集转换可以使用iconv
]]></description>
			<content:encoded><![CDATA[<p>在IE下默认是以UTF-8的方式编码URL，向服务器发送请求，当中文出现在URL中的时候，就会被以UTF-8的方式编码，发送向服务器。这个时候服务器的字符集就会影响到WEB对URL的解码。</p>
<p>很多时候在其实不论是NGINX还是APACHE，问题的本质在于浏览器端请求的字符集和服务器端的字符集是否一致，当出现不一致的时候，服务器就无法找到请求的路径，从而出现404  NOT FOUND的错误。解决方案可以从以下几方面开始：<span id="more-1101"></span></p>
<p>1、服务器的系统字符集</p>
<p>在centos下可以用echo  $LANG查看。可以在vi /etc/profile 中增加</p>
<p>export zh_CN.utf-8</p>
<p>export  LANG=zh_CN.utf-8</p>
<p>然后重新启动服务器，即可生效</p>
<p>2、nginx的conf文件中配置的字符集</p>
<p>在/www/wdlinux/nginx/conf/nginx.conf中的charset设置。</p>
<p>3、被请求的文件路径或者文件名的字符集。</p>
<p>第1和第2点更改很容易，第3点，更改文件名的字符集，需要使用工具convmv才能完成</p>
<p>convmv  可以从<a href="http://j3e.de/linux/convmv" target="_blank">http://j3e.de/linux/convmv</a> 下载，</p>
<p>wget <a href="http://j3e.de/linux/convmv/convmv-1.14.tar.gz" target="_blank">http://j3e.de/linux/convmv/convmv-1.14.tar.gz</a></p>
<p>tar  -zxvf convmv-1.14.tar.gz</p>
<p>cd convmv-1.14</p>
<p>make  clean;</p>
<p>make install;</p>
<p>如：</p>
<p>./convmv -f GB2312 -t UTF-8  -r &#8211;nosmart &#8211;notest userfiles/*.*</p>
<p>以上表示  userfiles下的所有文件的文件名由GB2312转换为UTF-8</p>
<p>对于文件内容的字符集转换可以使用iconv</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/support-chinese-in-liunx.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
