[Ide] Fix bug 21254 - Get the encoding from the document content instead of returning Encoding.Default.