From: "Mehr, Assaph (Assaph)" Date: 2004-08-30T12:50:58+09:00 Subject: Re: Trapping errors within unpack? > I'm trying to do a simple conversion between UTF-8 and 8-bit ascii. > The key part of my program goes like this: > ARGF.each { > |line| > puts line.unpack('U*').pack('c*') > } You can of course trap the Illegal argument excpetion for each line, but it seems it doesn't report the position of the error within the string. Have you tried Iconv? IIRC it reports the part of the string with the illegal sequence. HTH, Assaph