Questions about $nlslocale and $nlssortorder and their scope

Author: david.andersson@umu.se (DavidAndersson)

We are using Swedish in our application and the binary sorting produces an erroneous result. E.g. the swedish letters Å and Ä is sorted in the wrong order. The desired solution to this problem would be to use the Swedish locale. However the $nlslocale has too big a scope and affects things we don’t want to change, e.g. '.' changing to ',' and the statement 0 < "-1" turning from false to true (and probably a lot more).

Under "Sorting Based on Locale" in the “Uniface Library” I can read:

"2.  If the Type argument is not specified, the value of $nlssortorder is used, as set by the $NLS_SORT_ORDER assignment setting or $nlssortorder Proc function."

And under “Language and Locale”:

“There may be circumstances when you want the locale to be ignored. For example, you may want sorting routines to apply locale-based rules, but case transformation code to ignore them.”

My thought then is to use only the $nlssortorder part, like this:
$nlslocale = “sv_SE”
$nlssortorder = “nlslocale”
$nlsformat = “classic”
$nlscase = “classic

My questions based on this are:
1.    Does $nlssortorder affect anything else besides sorting done by sort, sort/list, $sortlist and $sortlistid?
2.    Since I will have $nlslocale = “sv_SE”, will it affect anything outside of what $nlssortorder, $nlsformat and $nlscase controls?
3.    If the answer is yes on 1 or 2, is there any documentation to be found on what is affected?


I simply don’t want any surprises if I chose to use $nlssortorder to fix my sorting problem.
 

1 Comment

  1. Hello, we are currently working on the same problems. I am yet to contact Uniface technical support, because sort seems to be broken if locale is set. Unfortunately, setting only sorting seems to be quite difficult, since $nlssortorder can't be set to anything, but only via $nlslocale - this is quite a problem for us, since it influences many other things (e.g. numeric and date format in messages and in fields without any display format).

    I have the same idea as you (to set $nlslocale as we need it and then all $nlsxxxx to "classic"), but I haven't tested it yet in our biggest application. As for now, I had to turn all nls off.


    Author: sochaz (zdenek.socha@fullsys.cz)