Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/kconv.rb
Instance Method Summary collapse
-
#iseuc ⇒ Object
call-seq: String#iseuc -> obj or nil.
-
#issjis ⇒ Object
call-seq: String#issjis -> obj or nil.
-
#isutf8 ⇒ Object
call-seq: String#isutf8 -> obj or nil.
-
#kconv(out_code, in_code = Kconv::AUTO) ⇒ Object
call-seq: String#kconv(out_code, in_code = Kconv::AUTO).
-
#toeuc ⇒ Object
call-seq: String#toeuc -> string.
-
#tojis ⇒ Object
call-seq: String#tojis -> string.
-
#tosjis ⇒ Object
call-seq: String#tosjis -> string.
-
#toutf16 ⇒ Object
call-seq: String#toutf16 -> string.
-
#toutf8 ⇒ Object
call-seq: String#toutf8 -> string.
Instance Method Details
#iseuc ⇒ Object
call-seq:
String#iseuc -> obj or nil
Returns whether self
's encoding is EUC-JP or not.
Note don???t expect this return value is MatchData.
350 |
# File 'lib/kconv.rb', line 350 def iseuc; Kconv.iseuc(self) end |
#issjis ⇒ Object
call-seq:
String#issjis -> obj or nil
Returns whether self
's encoding is Shift_JIS or not.
Note don???t expect this return value is MatchData.
358 |
# File 'lib/kconv.rb', line 358 def issjis; Kconv.issjis(self) end |
#isutf8 ⇒ Object
call-seq:
String#isutf8 -> obj or nil
Returns whether self
's encoding is UTF-8 or not.
Note don???t expect this return value is MatchData.
366 |
# File 'lib/kconv.rb', line 366 def isutf8; Kconv.isutf8(self) end |
#kconv(out_code, in_code = Kconv::AUTO) ⇒ Object
call-seq:
String#kconv(out_code, in_code = Kconv::AUTO)
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.
277 278 279 |
# File 'lib/kconv.rb', line 277 def kconv(out_code, in_code=Kconv::AUTO) Kconv::kconv(self, out_code, in_code) end |
#toeuc ⇒ Object
call-seq:
String#toeuc -> string
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).
305 |
# File 'lib/kconv.rb', line 305 def toeuc; Kconv.toeuc(self) end |
#tojis ⇒ Object
call-seq:
String#tojis -> string
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).
294 |
# File 'lib/kconv.rb', line 294 def tojis; Kconv.tojis(self) end |
#tosjis ⇒ Object
call-seq:
String#tosjis -> string
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).
316 |
# File 'lib/kconv.rb', line 316 def tosjis; Kconv.tosjis(self) end |
#toutf16 ⇒ Object
call-seq:
String#toutf16 -> string
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).
338 |
# File 'lib/kconv.rb', line 338 def toutf16; Kconv.toutf16(self) end |