From d001519db8cdf1e97d558483b3cac92a694eb13a Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Thu, 31 Jan 2013 08:53:05 -0800 Subject: [PATCH 1/2] Correct buffer size in LocalizationEditor treeview. --- Sources/Tools/plLocalizationEditor/plLocTreeView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Tools/plLocalizationEditor/plLocTreeView.cpp b/Sources/Tools/plLocalizationEditor/plLocTreeView.cpp index f6e5b1fd..75373fd0 100644 --- a/Sources/Tools/plLocalizationEditor/plLocTreeView.cpp +++ b/Sources/Tools/plLocalizationEditor/plLocTreeView.cpp @@ -66,7 +66,7 @@ HTREEITEM AddLeaf(HWND hTree, HTREEITEM hParent, plString text, bool sort = true TVITEM tvi = {0}; tvi.mask = TVIF_TEXT | TVIF_PARAM; tvi.pszText = const_cast(buf.GetData()); - tvi.cchTextMax = static_cast(text.GetSize()); + tvi.cchTextMax = static_cast(buf.GetSize()); tvi.lParam = NULL; TVINSERTSTRUCT tvins = {0}; From 1366e2cb8b263f75b10e0b3c332d1e47c1f04bfb Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Thu, 31 Jan 2013 08:55:35 -0800 Subject: [PATCH 2/2] Modify XML signature to match UTF-8 output. --- .../FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp index 125a0f61..d47d19e8 100644 --- a/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp @@ -935,7 +935,7 @@ void pfLocalizationDataMgr::IWriteText(const plFileName & filename, const plStri // we will try to pretty print it all so it's easy to read for the devs plStringStream fileData; - fileData << "\n"; // stores the xml we are going to write to the file (UTF-16 format) + fileData << "\n"; fileData << "\n"; fileData << plString::Format("\t\n", ageName.c_str()); @@ -977,7 +977,7 @@ void pfLocalizationDataMgr::IWriteText(const plFileName & filename, const plStri { // now spit the results out to the file hsStream *xmlStream = plEncryptedStream::OpenEncryptedFileWrite(filename); - xmlStream->Write(fileData.GetLength(), fileData.GetString().c_str()); + xmlStream->Write(fileData.GetLength(), fileData.GetRawBuffer()); xmlStream->Close(); delete xmlStream; }