The regular expression functions belongs the group of function that are locale sensitive. From the IBM i Information Center:

"Locale Sensitive: The behavior of this function might be affected by the LC_CTYPE and LC_COLLATE categories of the current locale. This function is not available when LOCALETYPE(*CLD) is specified on the compilation command. For more information, see Understanding CCSIDs and Locales."

I always convert the pattern and the value to the CCSID of the current locale using ...

nl_langinfo(CODESET) to get the CCSID

QtqIconvOpen(), iconv() and iconv_close() to convert the CCSID

... before I use regcomp(), regexec() and regfree() to apply the regular expression to the value.


Am 22.03.2013 15:24, schrieb Tim Bronski:
I've cross posted this to the C list but it doesn't get much traffic so
this question might get more of an audience here. I've been having
issues with using regular expressions (as in a sscanf function) where
the locale might vary. I've looked all over the ibm site but there's
very little with any definition on exactly what effect locales have on
expression statements. How do I locale protect my expressions?

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.