# Issues with setting localeCompare to dk locale

**URL:** <https://community.postman.com/t/issues-with-setting-localecompare-to-dk-locale/45327>\
**Category:** Help Hub\
**Tags:** tests, json\
**Created:** [March 20, 2023, 8:28am UTC](https://community.postman.com/t/issues-with-setting-localecompare-to-dk-locale/45327 "2023-03-20T08:28:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronnieufst](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@ronnieufst](https://community.postman.com/u/ronnieufst)\
**Post date:** [March 20, 2023, 8:28am UTC](https://community.postman.com/t/issues-with-setting-localecompare-to-dk-locale/45327/1 "2023-03-20T08:28:53Z")

</div>

Im having an issues with running my test using newman in jenkins, as our jenkis have a different locale than my PC, and what i want to test on.

The test is simple enough, i store an array from the response, filter something i want to sort by, and use localeCompare to sort the list, and compare the results.

```auto
sorted.sort(function (a, b) {return a.toLowerCase().localeCompare(b.toLowerCase(), 'da');})

```

But what i noticed was that i got different results from newman, than when i tested it worked in postman.

I think i have narrowed it down to the fact, that localeCompare uses intl to set the locale as part of the function, and i assume its not working because from my understanding postman doesnt support intl anymore, and therefor even tho i try to set it to ‘dk’, it defaults to machines locale ?

Is there any way for me to set the locale, for localeCompare, or does anyone have a smart alternative that could aid me sorting a list using the DK ruleset ?
