void () { EncodingProjectManager.getInstance(getProject()).setNative2AsciiForPropertiesFiles(null, false); EncodingProjectManager.getInstance(getProject()).setDefaultCharsetForPropertiesFiles(null, null); EncodingProjectManager.getInstance(getProject()).setEncoding(null, StandardCharsets.UTF_8); PlatformTestUtil.withEncoding("UTF-8", () -> { configureByText("\\u1234\\uxxxx\\n\\t\\y=\\u3210\\uzzzz\\n\\t\\y"); List<IProperty> properties = ((PropertiesFile)myFile).getProperties(); assertEquals(1, properties.size()); final Property property = (Property)properties.get(0); assertEquals("\\u1234\\uxxxx\\n\\t\\y", property.getKey()); assertEquals("\\u3210\\uzzzz\\n\\t\\y", property.getValue()); ApplicationManager.getApplication().runWriteAction(() -> { property.setName("\\u041f\\uyyyy\\n\\t\\y"); }); FileDocumentManager.getInstance().saveAllDocuments(); VirtualFile virtualFile = myFile.getVirtualFile(); // copy to other file type to stop charset mingling VirtualFile newFile = copy(virtualFile, virtualFile.getParent(), "xxx.txt"); String chars = VfsUtilCore.loadText(newFile); assertEquals("\\u041f\\uyyyy\\n\\t\\y=\\u3210\\uzzzz\\n\\t\\y", chars); }); }