From: Nathan Olberding Date: 2006-05-04T09:01:06+09:00 Subject: Re: Searching Files Dave Howell wrote: > That strongly implies that the problem is with your search terms, not > your code. Or to put it another way, that what you think is in those > files, isn't actually there. > > For example, if you try to search for something like /this phrase/ in a > file that's been saved as UTF-16 and your searching program doesn't > know that, then you won't find that phrase, because it doesn't exist. > In the file, it would be more like ?t?h?i?s? ?p?h?r?a?s?e where the ?'s > represent an ASCII "NUL" character, 00. > > If you're trying to search Word files, or RTF files, then there's all > sorts of stuff that might be stored between the items of your search. > > So what, exactly, are you trying to search for, and are you positive > that it's actually in the files? Excellent, excellent question! Some of these files definitely have non-ASCII encodings. This... is kind of frustrating. cat will show the contents of the files, vim will edit the files... what do I do in my code to deal with this? Not every file is of the same encoding. -- Posted via http://www.ruby-forum.com/.