From ca49fe7ddf05e65793b51310e681d295652232b7 Mon Sep 17 00:00:00 2001 From: Hokwon Song Date: Tue, 2 Apr 2013 09:49:22 +0900 Subject: [PATCH] Fixed a defect on Locales and Text Change-Id: I13ebe6e928c942f0d57e81006c88ccbccca28793 Signed-off-by: Hokwon Song --- src/locales/FLclCalendar.cpp | 2 +- src/text/FText_GsmEncodingCore.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/locales/FLclCalendar.cpp b/src/locales/FLclCalendar.cpp index 5def2d3..90005d9 100644 --- a/src/locales/FLclCalendar.cpp +++ b/src/locales/FLclCalendar.cpp @@ -185,7 +185,7 @@ Calendar::Equals(const Object& obj) const SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use."); const Calendar* pOtherInstance = dynamic_cast< const Calendar* >(&obj); - if ((pOtherInstance == null) || (pOtherInstance->_pCalendarImpl == null)) + if ((pOtherInstance == null) || (pOtherInstance->_pCalendarImpl == null) || GetType() != pOtherInstance->GetType()) { return false; } diff --git a/src/text/FText_GsmEncodingCore.cpp b/src/text/FText_GsmEncodingCore.cpp index 4208682..53146f1 100644 --- a/src/text/FText_GsmEncodingCore.cpp +++ b/src/text/FText_GsmEncodingCore.cpp @@ -289,6 +289,11 @@ _GsmEncodingCore::EncodeN(const wchar_t* pSrc, int srcLength, int& retLength) wchar_t* _GsmEncodingCore::DecodeN(const byte* pSrc, int srcLength, int& retLength) { + if (srcLength > 1 && pSrc && pSrc[srcLength - 1] == '\0') + { + --srcLength; + } + result r = GetCharCount(pSrc, srcLength, retLength); SysTryReturn(NID_TEXT, !IsFailed(r), null, r, "[%s] Encoding failed", GetErrorMessage(r)); -- 2.7.4