if (file == null || !file.isInLocalFileSystem()) return;
// Prevent "setEncoding" calling "saveAll" from causing an endless loop
isApplyingSettings = true;
final String filePath = file.getCanonicalPath();
final List<OutPair> outPairs = SettingsProviderComponent.getInstance().getOutPairs(filePath);
final EncodingProjectManager encodingProjectManager = EncodingProjectManager.getInstance(project);
final String charset = Utils.configValueForKey(outPairs, charsetKey);
if (!charset.isEmpty()) {
if (encodingMap.containsKey(charset)) {
encodingProjectManager.setEncoding(file, encodingMap.get(charset));
LOG.debug(Utils.appliedConfigMessage(charset, charsetKey, filePath));
} else {
LOG.warn(Utils.invalidConfigMessage(charset, charsetKey, filePath));
}
}