Some Keyboards fail with ANSI applications on Windows Vista RTM.


There’s an unfortunate Windows Vista bug that causes keyboards to fail in ANSI applications.  Its amusing in a sad sort of way since this bug missed about a dozen checks we have to make sure this kind of thing doesn’t happen.

Anyway, keyboards attached to the following locales might have this problem for some or most characters.  (I made this list with a quick script and didn’t test all characters/languages, so this might not be completely accurate)

  • Romanian (Romania)
  • Ukrainian (Ukraine)
  • Serbian (Latin, Bosnia and Herzegovina)
  • Urdu (Islamic Republic of Pakistan)
  • Belarusian (Belarus)
  • Persian
  • Azeri (Latin, Azerbaijan)
  • Uzbek (Latin, Uzbekistan)
  • Welsh (United Kingdom)
  • Turkmen (Turkmenistan)
  • Irish (Ireland)
  • Uighur (PRC)
  • Upper Sorbian (Germany)
  • Hausa (Latin, Nigeria)
  • Yoruba (Nigeria)
  • Dari (Afghanistan)
  • Lower Sorbian (Germany) (no locale specific keyboards by default)
  • K’iche (Guatemala) (no locale specific keyboards by default)
  • Wolof (Senegal) (no locale specific keyboards by default)
  • Igbo (Nigeria) (no locale specific keyboards by default)
  • Chinese (Traditional, Hong Kong S.A.R.) (the IME doesn’t use rely on the bug so this shouldn’t be a “real” problem)

Additionally these locales are “Unicode Only” and shouldn’t work with ANSI applications, however this bug could cause code pages to be used with keyboards that give the appearance of working, but could have bad mappings:

  • Kazakh (Kazakhstan)
  • Maori (New Zealand)
  • Pashto (Afghanistan)
  • Maltese (Malta) (no locale specific keyboards by default)

The bug is a broken LOCALESIGNATURE data for these locales.  (Exposed as LOCALE_FONTSIGNATURE by GetLocaleInfoEx, although Michael points out the name’s confusing in “It isn’t a FONTSIGNATURE, darn it!“) 

The IsCsbDefault and IsCsbSupported fields of LOCALESIGNATURE have misleading information in Vista, and the ANSI keyboard code use IsCsbDefault to figure out the ANSI code page to use when mapping characters.  Presumably LOCALE_IDEFAULTANSICODEPAGE would’ve been a better choice here, but that wasn’t used.  In general we’d recommend not using the LOCALESIGNATURE or FONTSIGNATURE values since they have historically been fairly inaccurate and change a lot between versions.

We’re working on a fix for this bug, and I’ll try to post a pointer when it gets posted, but it’ll take a while.

As a workaround we’re lucky that we introduced the Custom Locale feature in Vista.  You can use the CultureAndRegionInfoBuilder .Net class to create a custom culture with a corrected font signature.  For locales that shipped in XP you can just get the value from XP, or you could use the value from another culture that has the same LOACLE_IDEFAULTANSICODEPAGE as the target locale.  Once corrected, the custom locale will cause this data to be loaded correctly and your keyboard should work in ANSI applications.  Note that the custom locale will override any locales we may ship in the future, so you’ll need to make sure to uninstall your custom locale after applying any patch.

Interestingly enough this bug was reported in an application that touted itself as being a Unicode application.  We’ve discovered that several “unicode” applications aren’t thoroughly Unicode, and rely on ANSI input (otherwise they wouldn’t hit this bug).

Hope this information is useful.

Comments (11)

  1. So when I first posted Double Secret ANSI, part 1 (Somewhere between ANSI and Unicode) , I was only a

  2. shawnste says:

    Michael has cooler titles than I do.  He talks about the technical cause of this bug in his post: http://blogs.msdn.com/michkap/archive/2007/03/20/1917161.aspx

  3. ross104 says:

    Hi! Is it possible to know when fix will be released? Cause Im a Vista user (Ultimate + Russian MUI) and live in Ukraine. And I need a ukrainian language support in all aplications. Cause now I get "?????" and it sould be "абвгд"

  4. shawnste says:

    A workaround is to create a custom locale with a corrected font signature.  (Saving as LDML makes the font data more readable).  We’re working on a fix, but it will take a while before it makes it to the "real world."  Which ANSI application is giving you trouble?

  5. ross104 says:

    Total Commander, Liga (Its Ukrainian Law database) and in Lotus Notes sometime I get right to left fileds…

  6. [Updated Mar 30 2007: Mike pointed out errors which I’ve corrected] Many applications are "still" ANSI

  7. > Which ANSI application is giving you trouble?

    WinEdt, Lotus SmartSuite. Also practically all television subtitling software, because most actual subtitle files are ANSI format, at best.

    Cristi

  8. Dmitry says:

    Anybody solve problem? 🙁

  9. Yes, the problem has been solved – see this http://support.microsoft.com/kb/936060

    And for me (Romanian) it worked, both the request to Microsoft support and the patch itself 🙂

    Cristi

  10. Valery says:

    Skype does not work properly with Ukrainian Language. It displays "??????" instead of text. I tried using any Ukrainian Keyboard layout in Vista – same effect. Why fix is not released yet?

  11. shawnste says:

    Why isn’t Skype Unicode?