Faced a problem with detecting file encoding when file is with no encoding preamble Bytes FE and FF (0xFE,0xFF) encoded useing given encoding. The problem was that flash movie, which uses xml data source as input parameter was not able to detect the encoding of the source. (.NET web form) I’ve solved this problem by writeing the preamble in the begining of the Http Response. I think problems of this kind hapens to many programmers.
I used C# code to solve the problem: