<?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>The GITS Blog &#187; full-width</title>
	<atom:link href="http://ginstrom.com/scribbles/tag/full-width/feed/" rel="self" type="application/rss+xml" />
	<link>http://ginstrom.com/scribbles</link>
	<description>Random scribbling about programming, translation, and Japan</description>
	<lastBuildDate>Thu, 05 Aug 2010 13:07:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>wchartype: Python module to get full-width (double-byte) character types</title>
		<link>http://ginstrom.com/scribbles/2008/09/28/wchartype-python-module-to-get-full-width-double-byte-character-types/</link>
		<comments>http://ginstrom.com/scribbles/2008/09/28/wchartype-python-module-to-get-full-width-double-byte-character-types/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 03:22:43 +0000</pubDate>
		<dc:creator>Ryan Ginstrom</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[double-byte]]></category>
		<category><![CDATA[full-width]]></category>
		<category><![CDATA[hangul]]></category>
		<category><![CDATA[hiragana]]></category>
		<category><![CDATA[kanji]]></category>
		<category><![CDATA[katakana]]></category>

		<guid isPermaLink="false">http://ginstrom.com/scribbles/?p=342</guid>
		<description><![CDATA[When dealing with full-width (especially CJK) characters, you'll often want to know the type of a particular character &#8212; Kanji/Hanzi/Hanja, hiragana, katakana, and so on. wchartype is a Python module that will determine the type of a full-width character. The functions all expect Unicode strings of length one. Usage: import wchartype if wchartype.is_asian&#40;u'\u65e5&#8242;&#41;: &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>When dealing with full-width (especially <a href="http://en.wikipedia.org/wiki/CJK">CJK</a>) characters, you'll often want to know the type of a particular character &#8212; Kanji/Hanzi/Hanja, hiragana, katakana, and so on.</p>
<p>wchartype is a Python module that will determine the type of a full-width character. The functions all expect Unicode strings of length one.</p>
<p>Usage:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw1">import</span> wchartype<br />
<span class="kw1">if</span> wchartype.<span class="me1">is_asian</span><span class="br0">&#40;</span>u<span class="st0">'<span class="es0">\u</span>65e5&#8242;</span><span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; <span class="kw1">print</span> u<span class="st0">&quot;<span class="es0">\u</span>65e5 is an Asian character&quot;</span></p>
<p>sentence = u<span class="st0">&quot;this has ひらがな&quot;</span><br />
<span class="kw1">if</span> any<span class="br0">&#40;</span>wchartype.<span class="me1">is_hiragana</span><span class="br0">&#40;</span>x<span class="br0">&#41;</span> <span class="kw1">for</span> x <span class="kw1">in</span> sentence<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&quot;'%s' has one or more hiragana characters&quot;</span> % sentence<br />
&nbsp;</div>
<p>wchartype has a home on <a href="http://pypi.python.org/pypi/wchartype/">pypi</a> and can be installed via easy_install:</p>
<div class="dean_ch" style="white-space: wrap;">
<p>easy_install wchartype<br />
&nbsp;</div>
<p>Here is the <a href="/code/wchartype.html">permanent page for wchartype</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ginstrom.com/scribbles/2008/09/28/wchartype-python-module-to-get-full-width-double-byte-character-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
