Skip to content

Commit

Permalink
- Fix UTF-8 locale
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12458 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Aug 9, 2012
1 parent 8981df9 commit 01ca5d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Compiler/runtime/systemimpl.c
Expand Up @@ -1734,10 +1734,10 @@ void SystemImpl__gettextInit(const char *locale)
char *locale3 = NULL;
asprintf(&locale2, "%s.utf8", locale);
asprintf(&locale3, "%s.UTF-8", locale);
int res = *locale == 0 ? setlocale(LC_MESSAGES, locale)!=0 :
int res = *locale == 0 ? setlocale(LC_MESSAGES, "") && setlocale(LC_CTYPE, ""):
(setlocale(LC_MESSAGES, locale3) && setlocale(LC_CTYPE, locale3)) ||
(setlocale(LC_MESSAGES, locale2) && setlocale(LC_CTYPE, locale2)) ||
setlocale(LC_MESSAGES, locale);
setlocale(LC_MESSAGES, locale) && setlocale(LC_CTYPE, locale);
if (!res) {
const char *c_tokens[1]={locale};
fprintf(stderr, gettext("Warning: Failed to set locale: '%s'\n"), locale);
Expand Down

0 comments on commit 01ca5d7

Please sign in to comment.