Extended maintenance of Ruby versions 1.8.7 and 1.9.2 will end on July 31, 2014. Read more

In Files

  • nkf/lib/kconv.rb

Class/Module Index [+]

Quicksearch

String

Public Instance Methods

String#iseuc → obj or nil click to toggle source

Returns whether self‘s encoding is EUC-JP or not.

Note don't expect this return value is MatchData.

 
               # File nkf/lib/kconv.rb, line 350
def iseuc;    Kconv.iseuc(self) end
            
String#issjis → obj or nil click to toggle source

Returns whether self‘s encoding is Shift_JIS or not.

Note don't expect this return value is MatchData.

 
               # File nkf/lib/kconv.rb, line 358
def issjis;   Kconv.issjis(self) end
            
String#isutf8 → obj or nil click to toggle source

Returns whether self‘s encoding is UTF-8 or not.

Note don't expect this return value is MatchData.

 
               # File nkf/lib/kconv.rb, line 366
def isutf8;   Kconv.isutf8(self) end
            
String#kconv(out_code, in_code = Kconv::AUTO) click to toggle source

Convert self to out_code. out_code and in_code are given as constants of Kconv.

Note This method decode MIME encoded string and convert halfwidth katakana to fullwidth katakana. If you don't want to decode them, use NKF.nkf.

 
               # File nkf/lib/kconv.rb, line 277
def kconv(out_code, in_code=Kconv::AUTO)
  Kconv::kconv(self, out_code, in_code)
end
            
String#toeuc → string click to toggle source

Convert self to EUC-JP

Note This method decode MIME encoded string and convert halfwidth katakana to fullwidth katakana. If you don't want it, use NKF.nkf('-exm0', str).

 
               # File nkf/lib/kconv.rb, line 305
def toeuc; Kconv.toeuc(self) end
            
String#tojis → string click to toggle source

Convert self to ISO-2022-JP

Note This method decode MIME encoded string and convert halfwidth katakana to fullwidth katakana. If you don't want it, use NKF.nkf('-jxm0', str).

 
               # File nkf/lib/kconv.rb, line 294
def tojis; Kconv.tojis(self) end
            
String#tosjis → string click to toggle source

Convert self to Shift_JIS

Note This method decode MIME encoded string and convert halfwidth katakana to fullwidth katakana. If you don't want it, use NKF.nkf('-sxm0', str).

 
               # File nkf/lib/kconv.rb, line 316
def tosjis; Kconv.tosjis(self) end
            
String#toutf16 → string click to toggle source

Convert self to UTF-16

Note This method decode MIME encoded string and convert halfwidth katakana to fullwidth katakana. If you don't want it, use NKF.nkf('-w16xm0', str).

 
               # File nkf/lib/kconv.rb, line 338
def toutf16; Kconv.toutf16(self) end
            
String#toutf8 → string click to toggle source

Convert self to UTF-8

Note This method decode MIME encoded string and convert halfwidth katakana to fullwidth katakana. If you don't want it, use NKF.nkf('-wxm0', str).

 
               # File nkf/lib/kconv.rb, line 327
def toutf8; Kconv.toutf8(self) end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus