Click to Rate and Give Feedback
MSDN
MSDN Library
Working with Collation Versioning

This content has moved to another location. See International Support for the latest version.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
GetNlsVersionEx is REQUIRED to correctly distinguish if a sort behavior has changed!      Shawn Steele [MSFT]   |   Edit   |   Show History

GetNlsVersionEx is required to correctly distinguish if a sort behavior has changed!

GetNlsVersionEx is preferred. The original version of this API doesn't return enough information in the case of a custom locale to tell if the sort has changed.

Tags What's this?: Add a tag
Flag as ContentBug
Steps to tell if a sort version changed (ie: you need to reindex):      Shawn Steele [MSFT]   |   Edit   |   Show History

Steps to tell if a sort version changed (ie: you need to reindex):

  1. Use GetNLSVersionEx() to retrieve an NLSVERSIONINFOEX structure when doing the original indexing of your data.
  2. Store the following properties with your index to identify the version:
    NLSVERSIONINFOEX.dwNLSVersion - This specifies the version of the sorting table you're using.
    NLSVERSIONINFOEX.dwEffectiveId - This specifies the effective locale of your sort. A custom locale will point to an in-box locale's sort.
    NLSVERSIONINFOEX.guidCustomVersion - This is a GUID specifying a specific custom sort for custom locales that have them.
  3. When using the index use GetNlsVersionEx() to discover the version of your data.
  4. If any of the three properties has changed, the sorting data you're using could return different results and any indexing you have may fail to find records.
  5. If you KNOW that your data doesn't contain invalid Unicode code points (ie: all of your strings passed a call to IsNLSDefineString()) then you may consider them the same if ONLY the low byte of dwNLSVersion changed (the minor version described above).

Blogged more about it at: http://blogs.msdn.com/shawnste/archive/2007/06/01/how-to-tell-if-the-collation-version-changed.aspx

Hope that helps, Shawn

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker