<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Shugo's Blog comments on Why jcode.rb?</title>
    <link>http://blog.shugo.net/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Shugo's Blog comments</description>
    <item>
      <title>"Why jcode.rb?" by shugo</title>
      <description>&lt;p&gt;I'm wondering why so many people use jcode.rb on Rails.  jcode.rb may break other libraries because it redefines some methods of String.  So I recommend you not to use jcode.rb if it is not really necessary.&lt;/p&gt;

&lt;p&gt;In many cases, you can use Regexp instead.  For example,&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require "jcode"

$KCODE = "u"
s.each_char do |ch|
  puts ch
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This code can be rewritten like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;s.scan(/./mu) do |ch|
  puts ch
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I admit that the latter is less readable than the former.
M17N features or selector namespace will fix this problem completely in the near future, I hope.&lt;/p&gt;

</description>
      <pubDate>Fri, 16 Sep 2005 23:59:00 JST</pubDate>
      <guid>&lt;a href="/articles/2005/09/16/why-jcode-rb"&gt;Why jcode.rb?&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2005/09/16/why-jcode-rb"&gt;Why jcode.rb?&lt;/a&gt;</link>
    </item>
  </channel>
</rss>

