开发者

Ruby install jcode

开发者 https://www.devze.com 2022-12-22 09:23 出处:网络
I\'m trying to get \'jcode\' for ruby, but I type \"gem install j开发者_如何转开发code\" and it says nothing exists?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号