Kconv (Module)

In: nkf/lib/kconv.rb

Methods

guess   kconv   toeuc   tojis   tosjis  

Constants

AUTO = NKF::AUTO
JIS = NKF::JIS
EUC = NKF::EUC
SJIS = NKF::SJIS
BINARY = NKF::BINARY
NOCONV = NKF::NOCONV
UNKNOWN = NKF::UNKNOWN

Public Instance methods

[Source]

# File nkf/lib/kconv.rb, line 54
  def guess(str)
    NKF::guess(str)
  end

[Source]

# File nkf/lib/kconv.rb, line 11
  def kconv(str, out_code, in_code = AUTO)
    opt = '-'
    case in_code
    when NKF::JIS
      opt << 'J'
    when NKF::EUC
      opt << 'E'
    when NKF::SJIS
      opt << 'S'
    end

    case out_code
    when NKF::JIS
      opt << 'j'
    when NKF::EUC
      opt << 'e'
    when NKF::SJIS
      opt << 's'
    when NKF::NOCONV
      return str
    end

    opt = '' if opt == '-'

    NKF::nkf(opt, str)
  end

[Source]

# File nkf/lib/kconv.rb, line 44
  def toeuc(str)
    NKF::nkf('-e', str)
  end

[Source]

# File nkf/lib/kconv.rb, line 39
  def tojis(str)
    NKF::nkf('-j', str)
  end

[Source]

# File nkf/lib/kconv.rb, line 49
  def tosjis(str)
    NKF::nkf('-s', str)
  end

[Validate]