Lets say I have records with values like 'TEST DATA' and 'test data' in some field. When I run SOQL (in Developer Console or from Apex) by user with EN locale, it arranges records with 'TEST DATA' and 'test data' values to one group, but when I run same query by user with non-English locale (or same user after switching locale to non-English), it separates records to different groups.
I tried several different non-English locales, like Spanish, German, Italian, and it works same.
The example of SOQL query is:
SELECT MyField__c MyField__c_2, GROUPING(MyField__c) grouping_MyField__c_2, SUM(Amount) SUM_Amount, count(Id) cnt FROM Opportunity GROUP BY ROLLUP(MyField__c) ORDER BY GROUPING(MyField__c) desc, MyField__c desc NULLS LAST
I think it should work same for any locales, and not sure why it's not. I know that in Salesforce SOQL sort order is determined by current user locale, but I observe same behavior for group by also, and don't know if this is correct behavior or not.