I cannot find any documentation from microsoft regarding what encoding is used to read the file content when using the SPWeb.GetFileAsString(url). Does anyone know?
This method is used to get XML, XSL files.
You need to use XmlTextReader in order to get the contents from a file.
One example is listed below:
XmlTextReader reader = new XmlTextReader(new StringReader(web.GetFileAsString("URLHere")));
When you are dynamically adding some WebPart this method helps to associate XML, XSL to that WebPart.
This function returns a .Net string so probably it is UTF-16(Default to .Net) encoded. :)