From b591964667f551cca9b8ef6afe4bdec93ad5a87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 21 Dec 2002 13:34:09 +0000 Subject: [PATCH] backported small part of wxrcedit improvements patch into 2.4.0 -- correctly setting encoding and version on newly created files git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/utils/wxrcedit/editor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/utils/wxrcedit/editor.cpp b/contrib/utils/wxrcedit/editor.cpp index a84cc5f336..d6eaa0778b 100644 --- a/contrib/utils/wxrcedit/editor.cpp +++ b/contrib/utils/wxrcedit/editor.cpp @@ -92,7 +92,7 @@ void wxXmlRcEditDocument::Upgrade() UpgradeNode(node); } node->DeleteProperty(wxT("version")); - node->AddProperty(wxT("version"), wxT(WX_XMLRES_CURRENT_VERSION_STRING)); + node->AddProperty(wxT("version"), WX_XMLRES_CURRENT_VERSION_STRING); } @@ -341,6 +341,12 @@ void EditorFrame::NewFile() m_FileName = ""; m_Resource = new wxXmlRcEditDocument; m_Resource->SetRoot(new wxXmlNode(wxXML_ELEMENT_NODE, _("resource"))); + m_Resource->SetFileEncoding("utf-8"); +#if !wxUSE_UNICODE + m_Resource->SetEncoding(wxLocale::GetSystemEncodingName()); +#endif + m_Resource->GetRoot()->AddProperty(_T("version"), + WX_XMLRES_CURRENT_VERSION_STRING); m_Modified = FALSE; RefreshTree();