<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>zhuoqun (zhuoqun)</title>
    <link>https://ruby-china.org/zhuoqun</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>Ruby 中的字符编码转换 Module: NKF</title>
      <description>&lt;p&gt;今天为一个乱码的问题头痛了半天，使用 Shell 下的 iconv 以及 ruby 自带的 Iconv 都失败了，最后发现了一个很好用的 Module: NKF.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ruby-doc.org/stdlib-1.9.2/libdoc/nkf/rdoc/NKF.html" rel="nofollow" target="_blank"&gt;http://ruby-doc.org/stdlib-1.9.2/libdoc/nkf/rdoc/NKF.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;和 Iconv 不同，使用 NKF 做字符编码转换的时候不需要直到原来的编码，只需要指定编码就行了。例如，如果我需要把字符转换成 UTF-8 编码，只要&lt;/p&gt;

&lt;p&gt;&lt;code&gt;string= NKF.nkf("-w", string)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;更多用法请参考手册。有了这个东西以后就不怕乱码问题了。&lt;img title=":smile:" alt="😄" src="https://twemoji.ruby-china.com/2/svg/1f604.svg" class="twemoji"&gt;&lt;/p&gt;</description>
      <author>zhuoqun</author>
      <pubDate>Tue, 23 Oct 2012 16:31:11 +0800</pubDate>
      <link>https://ruby-china.org/topics/6264</link>
      <guid>https://ruby-china.org/topics/6264</guid>
    </item>
    <item>
      <title>发现一个不错的汉字转拼音 Gem</title>
      <description>&lt;p&gt;因为要做类似微博的 @ 提醒功能，当用户名是汉字的时候希望可以通过全拼或每个字的拼音首字母进行匹配，然后就发现了这个 Gem:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/janx/ruby-pinyin" rel="nofollow" target="_blank"&gt;https://github.com/janx/ruby-pinyin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;经过测试，还是挺好用的。&lt;/p&gt;</description>
      <author>zhuoqun</author>
      <pubDate>Sun, 16 Sep 2012 15:44:03 +0800</pubDate>
      <link>https://ruby-china.org/topics/5566</link>
      <guid>https://ruby-china.org/topics/5566</guid>
    </item>
    <item>
      <title>第一次用 Rails 开发网站</title>
      <description>&lt;p&gt;第一次用 Rails 开发了一个网站：&lt;a href="http://caidianying.com/" rel="nofollow" target="_blank"&gt;http://caidianying.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rails + Twitter Bootstrap 用起来真是非常 happy.&lt;/p&gt;</description>
      <author>zhuoqun</author>
      <pubDate>Sat, 25 Aug 2012 12:15:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/5149</link>
      <guid>https://ruby-china.org/topics/5149</guid>
    </item>
  </channel>
</rss>
