Module: Rabbit::Converter

Defined in:
lib/rabbit/utils.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.to_eucjp(str) ⇒ Object


474
475
476
# File 'lib/rabbit/utils.rb', line 474

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

.to_eucjp_from_utf8(str) ⇒ Object


482
483
484
# File 'lib/rabbit/utils.rb', line 482

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

.to_utf8(str) ⇒ Object


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

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

.to_utf8_from_eucjp(str) ⇒ Object


478
479
480
# File 'lib/rabbit/utils.rb', line 478

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

Instance Method Details

#keep_kcode(new_kcode) ⇒ Object


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

def keep_kcode(new_kcode)
  yield
end