From: "Peter B. Ensch" Date: 2003-04-19T01:14:08+09:00 Subject: Re: How to test for text file Yukihiro Matsumoto wrote: > Hi, > > In message "How to test for text file" > on 03/04/17, "Peter B. Ensch" writes: > > |In perl, -T returns true if is a text file and > |-B returns true if is binary. > > You have to define what is text file first. Traditional Perl test > does not work for Japanese text (nor Unicode text). > > matz. Ah! Not having worked with Unicode before, I had not considered this. Does your answer assume that I need to define 'text file' and then open/read the file to see if it meets the definition? In other words, it is not possible to do something like: if text file open and process else do not open end BTW, thanks for answering my question, Matz, and thanks for ruby. I'm having a lot of fun learning it. P -- ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^^~^~^~^~^ Peter B. Ensch peterbe@attbi.com ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^^~^~^~^~^