[N_SE-43441] Fix date format.
authorHokwon Song <hokwon.song@samsung.com>
Fri, 28 Jun 2013 12:19:48 +0000 (21:19 +0900)
committerHokwon Song <hokwon.song@samsung.com>
Fri, 28 Jun 2013 12:25:18 +0000 (21:25 +0900)
Change-Id: Id2ecfd1ef0642583d9d0c4785524fe49ef866e06
Signed-off-by: Hokwon Song <hokwon.song@samsung.com>
src/setting/FSys_Icu.cpp

index 63a7c8d..c5f590d 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <stdlib.h>
 #include <memory.h>
+#include <runtime_info.h>
 
 #include <FBaseSysLog.h>
 #include <FBase_NativeError.h>
@@ -98,13 +99,13 @@ _Icu::GetDateTimeFormatN(const char* pIcuFormat)
        }
 
        UChar   customSkeleton[256] = {0, };
-       const char* pLocaleDefault = uloc_getDefault();
-
-       pDateTimeFormat = const_cast< char* > (pLocaleDefault);
-
-       u_uastrncpy(customSkeleton, pIcuFormat, sizeof(customSkeleton));
-       pFormatString = GetIcuPatternN(pDateTimeFormat, customSkeleton);
-
+       char* pRegionPtr;
+       if (runtime_info_get_value_string(RUNTIME_INFO_KEY_REGION, &pRegionPtr) == RUNTIME_INFO_ERROR_NONE)
+       {
+               u_uastrncpy(customSkeleton, pIcuFormat, sizeof(customSkeleton));
+               pFormatString = GetIcuPatternN(pRegionPtr, customSkeleton);
+               free(pRegionPtr);
+       }
        return pFormatString;
 }