private static @NotNull Charset getDefaultCharsetFromEncodingManager(@NotNull VirtualFile virtualFile) {
    EncodingRegistry encodingRegistry = EncodingRegistry.getInstance();
    Charset specifiedExplicitly = encodingRegistry.getEncoding(virtualFile, true);
    return specifiedExplicitly == null ? encodingRegistry.getDefaultCharset() : specifiedExplicitly;
  }
private static @NotNull Charset getDefaultCharsetFromEncodingManager(@NotNull VirtualFile virtualFile)