Module: Rabbit::Converter

Defined in:
lib/rabbit/utils.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.to_eucjp(str) ⇒ Object



462
463
464
# File 'lib/rabbit/utils.rb', line 462

def to_eucjp(str)
  NKF.nkf("-e", str)
end

.to_eucjp_from_utf8(str) ⇒ Object



470
471
472
# File 'lib/rabbit/utils.rb', line 470

def to_eucjp_from_utf8(str)
  NKF.nkf("-eW", str)
end

.to_utf8(str) ⇒ Object



458
459
460
# File 'lib/rabbit/utils.rb', line 458

def to_utf8(str)
  NKF.nkf("-w", str)
end

.to_utf8_from_eucjp(str) ⇒ Object



466
467
468
# File 'lib/rabbit/utils.rb', line 466

def to_utf8_from_eucjp(str)
  NKF.nkf("-wE", str)
end

Instance Method Details

#keep_kcode(new_kcode) ⇒ Object



445
446
447
# File 'lib/rabbit/utils.rb', line 445

def keep_kcode(new_kcode)
  yield
end