From: bjsp123@... (Benjamin Peterson) Date: 2003-09-22T23:09:58+09:00 Subject: Re: Trouble with binary files? Tim Hammerquist wrote in message news:... > However, (for backward compatibility?) when the ^Z *is* > encountered in a textmode file, ....or, better yet, when any text character whose encoding happens to include an 0x1a is encountered! My, that *was* annoying. > As someone else mentioned above, this isn't an issue on Unix or > many other systems, Or indeed on Windows, provided you avoid ruby :I > The moral of the story is: > > Always call fh.binmode() before reading > any non-text file on non-Unix platforms. You have to call it before reading *any* file, unless you just know that only ASCII was used, for the reason above. I think ruby is the only software I've ever used that has this issue. I suppose ruby must check for the 0x1a *before* allowing for the encoding system.