<?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>潔靜精微 &#187; 中文</title>
	<atom:link href="http://julabs.me/blog/tags/%e4%b8%ad%e6%96%87/feed/" rel="self" type="application/rss+xml" />
	<link>http://julabs.me/blog</link>
	<description>想努力创造完美的东西，必须具备心灵的纯洁，同时富于宗教精神。</description>
	<lastBuildDate>Wed, 18 Jan 2012 06:34:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>python中文乱码</title>
		<link>http://julabs.me/blog/python/python-chinese/</link>
		<comments>http://julabs.me/blog/python/python-chinese/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 09:05:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://julabs.me/blog/?p=73</guid>
		<description><![CDATA[虽然python的print命令可以用加“# -*- coding: cp936 -*-”方式输出中文，但在wxPython里如果用这种方法做按钮标题等仍然是乱码，后来找到了一个方法：在源文件头部的第一行或第二行加上源文件的文件编码格式就可以了，如下： # coding=&#60;encoding name&#62; 或： #!/usr/bin/python # -*- coding: &#60;encoding name&#62; -*- 其中的“&#60;encoding name&#62;”就是文件编码格式，如我用的格式是utf-8的，我的前两行是： #!/bin/env python # -*- coding: utf-8 -*-]]></description>
			<content:encoded><![CDATA[<p>虽然python的print命令可以用加“<code># -*- coding: cp936 -*-</code>”方式输出中文，但在wxPython里如果用这种方法做按钮标题等仍然是乱码，后来找到了一个方法：在源文件头部的第一行或第二行加上源文件的文件编码格式就可以了，如下：</p>
<pre><code class="python"># coding=&lt;encoding name&gt;</code></pre>
<p>或：</p>
<pre><code class="python">#!/usr/bin/python
# -*- coding: &lt;encoding name&gt; -*-
</code></pre>
<p>其中的“<code>&lt;encoding name&gt;</code>”就是文件编码格式，如我用的格式是utf-8的，我的前两行是：</p>
<pre><code class="python">#!/bin/env python
# -*- coding: utf-8 -*-
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://julabs.me/blog/python/python-chinese/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eclipse输出中文乱码</title>
		<link>http://julabs.me/blog/soft/eclipse-chinese/</link>
		<comments>http://julabs.me/blog/soft/eclipse-chinese/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 08:28:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[乱码]]></category>

		<guid isPermaLink="false">http://julabs.me/blog/?p=53</guid>
		<description><![CDATA[在eclipse的输出框中输出中文时有时会出现乱码，这是因为eclipse输出字符的编码与文件的编码不对应，只要设置下其输出字符的编码就可以了。 首先在工程上单击右键，在弹出菜单中选择Run As下的Open Run Dialog&#8230;选项。 这时会弹出一个对话框，在对话框的Common面板里找到Console Encoding一框，请选择与你文件相对应的字符编码。比如我的Python文件用的是UTF-8编码，于是我在Console Encoding就选择UTF-8选项，点击Apply按钮确认。 再输出信息你就可以看到可以正常输出中文了。 同理，如果在debug文件时输出中文乱码，用同样的方法设置debug的输出字符编码。]]></description>
			<content:encoded><![CDATA[<p>在eclipse的输出框中输出中文时有时会出现乱码，这是因为eclipse输出字符的编码与文件的编码不对应，只要设置下其输出字符的编码就可以了。</p>
<p class="img"><img src="/blog/img/08/eclipse_zh1.gif" width="546" height="358" alt="eclipse中文乱码" /></p>
<p><span id="more-53"></span></p>
<p>首先在工程上单击右键，在弹出菜单中选择<strong>Run As</strong>下的<strong>Open Run Dialog&#8230;</strong>选项。</p>
<p class="img"><img src="/blog/img/08/eclipse_zh2.gif" width="509" height="522" alt="eclipse中文乱码" /></p>
<p>这时会弹出一个对话框，在对话框的<strong>Common</strong>面板里找到<strong>Console Encoding</strong>一框，请选择与你文件相对应的字符编码。比如我的<a href="http://www.python.org/" target="_blank">Python</a>文件用的是<strong>UTF-8</strong>编码，于是我在<strong>Console Encoding</strong>就选择<strong>UTF-8</strong>选项，点击<strong>Apply</strong>按钮确认。</p>
<p class="img"><img src="/blog/img/08/eclipse_zh3.gif" width="651" height="578" alt="eclipse中文乱码" /></p>
<p>再输出信息你就可以看到可以正常输出中文了。</p>
<p class="img"><img src="/blog/img/08/eclipse_zh4.gif" width="566" height="355" alt="eclipse中文乱码" /></p>
<p>同理，如果在debug文件时输出中文乱码，用同样的方法设置debug的输出字符编码。</p>
]]></content:encoded>
			<wfw:commentRss>http://julabs.me/blog/soft/eclipse-chinese/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

