String (@NotNull VirtualFile file, final byte @NotNull [] content) { LoadTextUtil.DetectResult guessed = LoadTextUtil.guessFromContent(file, content); String charset = guessed.hardCodedCharset != null ? guessed.hardCodedCharset.name() : XmlCharsetDetector.extractXmlEncodingFromProlog(content); return charset == null ? CharsetToolkit.UTF8 : charset; }