In EWebView::GetPlatformLocale we didn't check if string returned by
setlocale(LC_CTYPE, 0) has character '_', we assumed it has, and it seems
this assumption was wrong
Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=11070
Reviewed by: Daniel Waślicki, Filip Piechocki, Jaesik Chang, Piotr Tworek
Change-Id: I8baddfad7a66a9356ad44e3bc2c3b3c6f312e8f7
Signed-off-by: Tomasz Czekala <t.czekala@partner.samsung.com>
if (!local_default)
return std::string("en-US");
std::string locale = std::string(local_default);
- locale.replace(locale.find('_'),1,"-");
- size_t position = locale.find('.');
+ size_t position = locale.find('_');
if (position != std::string::npos)
- locale = locale.substr(0,position);
+ locale.replace(position, 1, "-");
+ position = locale.find('.');
+ if (position != std::string::npos)
+ locale = locale.substr(0, position);
return locale;
}