in reply to How to check the encoding format of an XML
If you have some arbitrary (text or XML) file, maybe Encode::Guess can help you find out the encoding.