From 5a9f0b16b19c006c7c3f9f0c2dbd8d6cebb4b429 Mon Sep 17 00:00:00 2001 From: Wanne Date: Tue, 14 Jul 2009 08:37:08 +0000 Subject: [PATCH] - Merged 2 fixes from MP Branch o VFS: don't convert empty strings o Updated _PolishText.cpp git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3109 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Utils/_PolishText.cpp | 2 +- VFS/utf8string.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 2d107c36..6e2a8811 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -3298,7 +3298,7 @@ STR16 AimPopUpText[] = //If you try to hire more mercs than game can support - L"Masz już pełny zespół 18 najemników.", + L"You have a full team of mercs already.", L"Nagrana wiadomość", L"Wiadomość zapisana", diff --git a/VFS/utf8string.cpp b/VFS/utf8string.cpp index e03250fa..743a2cc7 100644 --- a/VFS/utf8string.cpp +++ b/VFS/utf8string.cpp @@ -203,6 +203,10 @@ std::string utf8string::as_utf8(utf8string const& str) } std::string utf8string::as_utf8(std::wstring const& str) { + if(str.length() == 0) + { + return ""; + } #if 0 std::string s; utf8::utf16to8(str.begin(), str.end(), std::back_inserter(s)); @@ -224,6 +228,10 @@ std::string utf8string::as_utf8(const wchar_t* str, unsigned int strlength) { len = wcslen(str); } + if(len == 0) + { + return ""; + } utf8::utf16to8(str,str+len,std::back_inserter(s)); return s; }