<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="0.92">
<channel>
	<title>Dryice Liu's Blog</title>
	<link>http://dryice.name/blog</link>
	<description></description>
	<lastBuildDate>Tue, 31 Aug 2010 12:01:11 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>unicode(str, &#34;utf-8&#34;) and str.encode(&#34;utf-8&#34;)</title>
		<description>the key is, unicode in Python is an object, unicode(str, "utf-8") makes that object from an utf-9 str, and str.encode("utf-8") encode a string to the utf-8 encoding.

To write unicode-aware python code, I'll need to:

	when getting data, use unicode(str, "the_encoding") to get an unicode object
	use unicode object inside my program, like ...</description>
		<link>http://dryice.name/blog/python/unicodestr-utf-8-and-strencodeutf-8/</link>
			</item>
	<item>
		<title>reading utf-8 file in Python</title>
		<description>
import codecs
fp = codecs.open(fileName, "r", "utf-8")
fp.read()


* http://evanjones.ca/python-utf8.html
* http://www.jorendorff.com/articles/unicode/python.html

Share This
 </description>
		<link>http://dryice.name/blog/python/reading-utf-8-file-in-python/</link>
			</item>
</channel>
</rss>

