Skip to content

Commit

Permalink
Filter "C." in the list of locales using language "en"
Browse files Browse the repository at this point in the history
Locales such as C.UTF-8 must set the language to "en" and not "c.u".

Issue eclipse-openj9/openj9#11620

Signed-off-by: Peter Shipton <[email protected]>
  • Loading branch information
pshipton committed Jan 18, 2021
1 parent 6ae7fae commit 7838184
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions port/unix/j9nlshelpers.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2019 IBM Corp. and others
* Copyright (c) 1991, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -117,7 +117,12 @@ nls_determine_locale(struct OMRPortLibrary *portLibrary)
}
#endif /* defined (J9ZOS390) */
#endif /* defined(LINUX) || defined(OSX) */
if ((NULL != lang) && strcmp(lang, "POSIX") && strcmp(lang, "C") && strcmp(lang, "UTF-8")) {
if ((NULL != lang)
&& (0 != strcmp(lang, "POSIX"))
&& (0 != strcmp(lang, "C"))
&& (0 != strncmp(lang, "C.", 2))
&& (0 != strcmp(lang, "UTF-8"))
) {
if ((NULL != lang) && ((langlen = strlen(lang)) >= 2)) {
/* copy the language, stopping at '_'
* CMVC 145188 - language locale must be lowercase
Expand Down

0 comments on commit 7838184

Please sign in to comment.