public Charset extractCharsetFromFileContent(@org.jetbrains.annotations.Nullable final Project project, @org.jetbrains.annotations.Nullable final VirtualFile file, @org.jetbrains.annotations.NotNull final CharSequence content) { LanguageFileType associatedFileType = getAssociatedFileType(file, project); if (associatedFileType == null) { return null; } return CharsetUtil.extractCharsetFromFileContent(project, file, associatedFileType, content); }
public Charset extractCharsetFromFileContent(@Nullable final Project project, @Nullable final VirtualFile file, @NotNull final CharSequence content) { LanguageFileType associatedFileType = getAssociatedFileType(file, project); if (associatedFileType == null) { return null; } return CharsetUtil.extractCharsetFromFileContent(project, file, associatedFileType, content); }
public LightVirtualFile(@NotNull String name, final FileType fileType, @NotNull CharSequence text, final long modificationStamp) { this(name, fileType, text, CharsetUtil.extractCharsetFromFileContent(null, null, fileType, text), modificationStamp); }
@Nullable("returns null if cannot determine from content") public static Charset charsetFromContentOrNull(@Nullable Project project, @NotNull VirtualFile virtualFile, @NotNull CharSequence text) { return CharsetUtil.extractCharsetFromFileContent(project, virtualFile, virtualFile.getFileType(), text); }
public LightVirtualFile(@Nonnull String name, final FileType fileType, @Nonnull CharSequence text, final long modificationStamp) { this(name, fileType, text, CharsetUtil.extractCharsetFromFileContent(null, null, fileType, text), modificationStamp); }
@Nullable public static Charset charsetFromContentOrNull(@Nullable Project project, @Nonnull VirtualFile virtualFile, @Nonnull CharSequence text) { return CharsetUtil.extractCharsetFromFileContent(project, virtualFile, virtualFile.getFileType(), text); }