Charset (@Nullable Project project, @NotNull VirtualFile virtualFile, @NotNull CharSequence text) { return ObjectUtils.notNull(charsetFromContentOrNull(project, virtualFile, text), virtualFile.getCharset()); }