tags:

views:

106

answers:

1

According to this article, there will be NLS sorting changes in Windows 7 that may affect certain applications.

I am trying to figure out if the application I am working on will be affected by these NLS sorting changes. I did some searching on msdn and identified a list if NLS sorting functions:

CompareString
CompareStringEx
CompareStringOrdinal
LCMapString
LCMapStringEx
LCMapStringEx
FindNLSString
FindNLSStringEx
FindStringOrdinal

I searched my application's codebase and it does not use any of the above functions. Is this enough to assume that my application will not be affected by NLS sorting changes?

In the above article it states that a Sort Change Robustness Diagnostic tool included in the Application Compatibility Toolkit can be used to check if your application is safe from the NLS changes. I downloaded the Application Compatibility Toolkit, but I am unable to find a Sort Change Robustness Diagnostic tool in the toolkit.

A: 

No, because many APIs end up hiding the fact that they're calling these APIs internally.

The real thing you need to worry about wrt NLS is if you're doing a database-like application where you have stored indices of data based on the sort order. The big danger is the following scenario:

  1. Database builds indexes on Vista, uses Vista's sort order
  2. You upgrade to Win7, but keep the data
  3. You go to make a lookup or add an entry, but use Win7's sort order
  4. Database gets corrupted / returns strange results

However, there is hope - you can use the GetNLSVersion API to determine whether to rebuild your indexes or not; when you build indexes, also cache the version you built them against. When you start up, if you see that the version is different (yes, it is rare but possible that the number could go down!), drop the indices and rebuild them.

Edit: If you're using a production database like SQL Server or MySQL, they handle this all for you behind the scenes, so don't worry if you're just querying these databases.

Paul Betts