End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Kconv.kconv
Kconv.kconv(str, to_enc, from_enc=nil)
ext/nkf/lib/kconv.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/ext/nkf/lib/kconv.rb, line 57
def kconv(str, to_enc, from_enc=nil)
opt = ''
opt += ' --ic=' + from_enc.to_s if from_enc
opt += ' --oc=' + to_enc.to_s if to_enc
::NKF::nkf(opt, str)
end