def inputEUCJP(uio)
show = Show.new
while true
input_sub_ISO_2022_JP_1(uio, show, :ascii)
bytes = [ ]
bytes.push(uio.getc)
break if !bytes[0]
if bytes[0] < 0x80
show.unicodeLetter(bytes, bytes[0])
elsif (bytes[0] == 0x8e ||
0xa1 <= bytes[0])
bytes.push(uio.getc)
if !bytes[1]
show.nonLetter([ bytes[0] ], $CHAR_PERIOD)
else
begin
show.unicodeLetter(bytes, to_unicode('EUC-JP', bytes.pack('C*')))
rescue Iconv::IllegalSequence, Iconv::InvalidCharacter
show.nonLetter([ bytes[0] ], $CHAR_PERIOD)
uio.ungetc(bytes[1])
end
end
elsif bytes[0] == 0x8f
bytes.push(uio.getc)
if !bytes[1]
show.nonLetter([ bytes[0] ], $CHAR_PERIOD)
else
bytes.push(uio.getc)
if !bytes[2]
show.nonLetter([ bytes[0], bytes[1] ], $CHAR_PERIOD)
else
begin
show.unicodeLetter(bytes, to_unicode('EUC-JP', bytes.pack('C*')))
rescue Iconv::IllegalSequence, Iconv::InvalidCharacter
show.nonLetter([ bytes[0] ], $CHAR_PERIOD)
uio.ungetc(bytes[2])
uio.ungetc(bytes[1])
end
end
end
end
end
show.flush
end