From 8f4c0b2e3b27ecb49720bb89135e9f476e0d3cc8 Mon Sep 17 00:00:00 2001 From: Hokwon Song Date: Wed, 3 Apr 2013 18:04:13 +0900 Subject: [PATCH] fix a decfect locale for france locale Change-Id: I9de789350e5da3a781964521a2864eaa8bbd8735 Signed-off-by: Hokwon Song --- src/locales/FLcl_LocaleData.cpp | 7 ++++++- src/locales/FLcl_NumberFormatterImpl.cpp | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/locales/FLcl_LocaleData.cpp b/src/locales/FLcl_LocaleData.cpp index f4a6a43..8c249f8 100644 --- a/src/locales/FLcl_LocaleData.cpp +++ b/src/locales/FLcl_LocaleData.cpp @@ -21,6 +21,7 @@ */ // Includes +#include #include #include #include @@ -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(""); } diff --git a/src/locales/FLcl_NumberFormatterImpl.cpp b/src/locales/FLcl_NumberFormatterImpl.cpp index 3ee1f5d..661899f 100644 --- a/src/locales/FLcl_NumberFormatterImpl.cpp +++ b/src/locales/FLcl_NumberFormatterImpl.cpp @@ -19,9 +19,9 @@ * @file FLclNumberFormatterEx.cpp * @brief This is the implementation file for the NumberFormatterEx class. */ - #include #include +#include #include #include @@ -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); -- 2.7.4