Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/base.rb

Instance Method Summary collapse

Instance Method Details

#to_eucObject Also known as: euc



15
16
17
# File 'lib/base.rb', line 15

def to_euc
  NKF.nkf("-e", self)
end

#to_uri_encode(nkf_charset = "-e") ⇒ Object Also known as: uri_encode

nkf_charset

-e:EUC, -w:UTF-8, -s:SJIS(INOF mixiの文字コードはEUC)



21
22
23
# File 'lib/base.rb', line 21

def to_uri_encode(nkf_charset = "-e")
  URI.encode(NKF.nkf(nkf_charset, self))
end

#to_utf8Object Also known as: utf8



10
11
12
# File 'lib/base.rb', line 10

def to_utf8
  NKF.nkf("-Lu -d -w", self)
end