require ‘nkf’
(0xf0…0xf9).each do |c1|
(0x40…0xfc).each do |c2|
next if c2 == 0x7f
cp932 = [c1, c2].pack(“C*”)
cp50221 = NKF.nkf(“-m0x --ic=cp932 --oc=cp50221”, cp932)
cp932_bak = NKF.nkf(“-m0x --ic=cp50221 --oc=cp932”, cp50221)
if cp932_bak.empty?
puts [cp932.unpack(“H*”), cp50221.unpack(“H*”)].join(" ")
end
end
end
require ‘nkf’
(0xf0…0xf9).each do |c1|
(0x40…0xfc).each do |c2|
next if c2 == 0x7f
cp932 = [c1, c2].pack(“C*”)
cp50221 = NKF.nkf(“-m0x --ic=cp932 --oc=cp50221”, cp932)
cp932_bak = NKF.nkf(“-m0x --ic=cp50221 --oc=cp932”, cp50221)
if cp932_bak.empty?
puts [cp932.unpack(“H*”), cp50221.unpack(“H*”)].join(" ")
end
end
end
require ‘nkf’
(0xf0…0xf9).each do |c1|
(0x40…0xfc).each do |c2|
next if c2 == 0x7f
cp932 = [c1, c2].pack(“C*”)
cp50221 = NKF.nkf(“-m0x --ic=cp932 --oc=cp50221”, cp932)
cp932_bak = NKF.nkf(“-m0x --ic=cp50221 --oc=cp932”, cp50221)
if cp932_bak.empty?
puts [cp932.unpack(“H*”), cp50221.unpack(“H*”)].join(" ")
end
end
end
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.