Ruby install jcode
I'm trying to get 'jcode' for ruby, but I type "gem install j开发者_如何转开发code" and it says nothing exists?
Does anyone know why? I'm trying to manipulate UTF-8 encoded strings.
Ruby >= 1.9 doesn't require jcode, a module to handle japanese (EUC/SJIS) strings, as it supports unicode natively.
This should fix the problem:
require 'jcode' if RUBY_VERSION < '1.9'
but must say I did not test it deeply...
Have you tried simply:
require 'jcode'
?
As it happens, jcode is part of the Ruby Standard Library.
Try not to include it at all. It should be included automatically in later versions of Ruby.
精彩评论