Fix the fallback about setlocale 60/159060/1
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 7 Nov 2017 00:43:57 +0000 (09:43 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 7 Nov 2017 00:43:57 +0000 (09:43 +0900)
Change-Id: I2fe8a5eeeabfb20eb59f4682ff58d54fdc34751b
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/base/appcore_base.c

index 5c495f5..91913f8 100644 (file)
@@ -575,7 +575,7 @@ static void __update_lang(void)
                setenv("LC_MESSAGES", lang, 1);
                r = setlocale(LC_ALL, "");
                if (r == NULL) {
-                       r = setlocale(LC_ALL, lang);
+                       r = setlocale(LC_ALL, "en_US.UTF-8");
                        if (r != NULL)
                                _DBG("*****appcore setlocale=%s\n", r);
                }
@@ -780,7 +780,6 @@ static int __get_app_name(const char *appid, char **name)
 static int __set_i18n(const char *domain, const char *dir)
 {
        char *r;
-       char *lan;
 
        if (domain == NULL) {
                errno = EINVAL;
@@ -797,14 +796,10 @@ static int __set_i18n(const char *domain, const char *dir)
        __update_region();
 
        r = setlocale(LC_ALL, "");
-       /* if locale is not set properly, try again to set as language base */
+       /* if locale is not set properly, try to set "en_US" again */
        if (r == NULL) {
-               lan = vconf_get_str(VCONFKEY_LANGSET);
-               if (lan != NULL) {
-                       r = setlocale(LC_ALL, lan);
-                       _DBG("*****appcore setlocale=%s\n", r);
-                       free(lan);
-               }
+               r = setlocale(LC_ALL, "en_US.UTF-8");
+               _DBG("*****appcore setlocale=%s\n", r);
        }
        if (r == NULL)
                _ERR("appcore: setlocale() error");