mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-77392 diff: use native-to-ascii charset for properties files
This commit is contained in:
@@ -14,5 +14,6 @@
|
||||
<orderEntry type="module" module-name="platform-api" />
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
<orderEntry type="module" module-name="vcs-api-core" />
|
||||
<orderEntry type="module" module-name="boot" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.intellij.diff.contents;
|
||||
|
||||
import com.intellij.ide.highlighter.ProjectFileType;
|
||||
import com.intellij.lang.properties.charset.Native2AsciiCharset;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
|
||||
@@ -11,6 +13,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.encoding.EncodingManager;
|
||||
import com.intellij.util.LineSeparator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -131,6 +134,10 @@ public class FileAwareDocumentContent extends DocumentContentImpl {
|
||||
charset = currentCharset;
|
||||
}
|
||||
|
||||
if (ProjectFileType.INSTANCE.equals(fileType) && EncodingManager.getInstance().isNative2AsciiForPropertiesFiles()) {
|
||||
charset = Native2AsciiCharset.wrap(charset);
|
||||
}
|
||||
|
||||
return charset;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user