fix a decfect locale for france locale
authorHokwon Song <hokwon.song@samsung.com>
Wed, 3 Apr 2013 09:04:13 +0000 (18:04 +0900)
committerHokwon Song <hokwon.song@samsung.com>
Wed, 3 Apr 2013 09:04:13 +0000 (18:04 +0900)
Change-Id: I9de789350e5da3a781964521a2864eaa8bbd8735
Signed-off-by: Hokwon Song <hokwon.song@samsung.com>
src/locales/FLcl_LocaleData.cpp
src/locales/FLcl_NumberFormatterImpl.cpp

index f4a6a43..8c249f8 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 // Includes
+#include <locale.h>
 #include <memory>
 #include <stdlib.h>
 #include <unistd.h>
@@ -86,13 +87,17 @@ _LocaleData::GetIcuString(const String& ospStr)
 String
 _LocaleData::GetOspString(const IcuUnicodeString& icuStr)
 {
+       setlocale(LC_ALL, "C");
        int len = icuStr.length();                                  // get length
        if (len)                                                    // if icuStr is not empty
        {
                char out[len * 3 + 1];                                  // Create buffer of thrice the icuStr length
-               out[icuStr.extract(0, len, out)] = 0;                   // icuStr.extract() converts Unicode to UTF8
+               int end = icuStr.extract(0, len, out);
+               out[end] = 0;                   // icuStr.extract() converts Unicode to UTF8
+               setlocale(LC_ALL, "");
                return String(out);
        }
+       setlocale(LC_ALL, "");
        return String("");
 }
 
index 3ee1f5d..661899f 100644 (file)
@@ -19,9 +19,9 @@
  * @file        FLclNumberFormatterEx.cpp
  * @brief       This is the implementation file for the NumberFormatterEx class.
  */
-
 #include <unique_ptr.h>
 #include <unicode/decimfmt.h>
+#include <locale.h>
 
 #include <FBaseSysLog.h>
 #include <FLclNumberFormatter.h>
@@ -132,6 +132,7 @@ _NumberFormatterImpl::Format(long number, String& str, _FieldPosition pos) const
 result
 _NumberFormatterImpl::Format(double number, String& str, _FieldPosition pos) const
 {
+       setlocale(LC_ALL, "C");
        IcuUnicodeString icuStr;
        IcuFieldPosition icuPos = _LocaleData::GetIcuFieldPosition(pos);
        icuStr = __pIcuNumberFormatter->format(number, icuStr, icuPos);