Text files is basically a collection of undefined bytes, there are no built in logic that tells the user what encoding was used. To have that logic you will have to go for XML-files instead. So, the format of the text file is decided by the producer, and that knowledge could no be automated by the consumer (the SAS program), at least within SAS to my knowledge.
But I can't see this should be a problem. If you are building a SAS program to handle files, these files would not be created using a random encoding? You could be able to agree on an encoding in a file specification.
/Linus
Data never sleeps