From: Logan Capaldo Date: 2006-05-04T14:18:58+09:00 Subject: Re: Searching Files On May 4, 2006, at 12:00 AM, Nathan Olberding wrote: > Logan Capaldo wrote: >> Assuming you know the encodings of the files, you may want to look >> into iconv. >> Also check out $KCODE, or the -K command line option >> ri Iconv >> ri Iconv::iconv >> ri Iconv#iconv > > I'll have to check that out. Thanks! > >> What system are you on that 'cat' is so smart? (Maybe cat isn't so >> smart, the encodings may be supersets of ASCII although that makes me >> wonder why the ruby code doesn't work) Alternatively, what is the >> encodings of the files? > > OpenBSD 3.8. The particular file I'm looking at as my main test > subject > was saved with TextEdit on MacOS X 10.2. In a funny twist, here's what > the file shell command, run from BASH on OpenBSD 3.8, reports about > the > file in question: > > 2.txt: MPEG 1.0 Layer I, 128 kbit/s, ? Hz stereo > > -- > Posted via http://www.ruby-forum.com/. > Aha, then I'm going to guess that the encoding is probably Western (Mac) which if I am not mistaken is a variation on ISO-8895-1. Although the response from file is interesting. Is it possible it was saved as UTF16?