できたできた!ambiwidthは治らないけどw
require "socket"
senc = "Shift_JIS"
denc = "UTF-8"
buf = "".b
TCPSocket.open("koukoku.shadan.open.ad.jp", 23) do |sock|
while c = sock.getc
buf += c
x = buf.dup.force_encoding(senc)
if x.valid_encoding?
print x.encode(denc)
buf = "".b
end
end
end