2009-05-24

US English in SQLPLUS on Windows, or "Smart" software localization

Many applications originally developed in English have a nasty habit of trying to localize themselves in every possible way as soon as they see even the slightest hint of where the user is physically located (time zone setting, environment variable, obscure option in Windows regional settings, etc.). The result is often one or all of the following:
  • Partially-localized interface, as though the translators tried their best, then gave up.
  • Translations so horrible that you break your head trying to guess what the original text meant.
Currently, I use the following settings in my Windows XP installation:
  • Time zone: Moscow/St. Petersburg/Volgograd
  • Standards and Formats: English (United States)
  • Location: United States
  • Language for non-Unicode programs: Russian
In this configuration, Oracle 10g manages to put the following in the registry after installation:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_<ORACLE_HOME_NAME>\NLS_LANG=RUSSIAN_CIS.CL8MSWIN1251
Which means that error messages, dates and a ton of other stuff in SQLPLUS will be in Russian. On top of this, the default settings of the Windows command prompt use a font and code page which do not correspond to the above registry setting and will not display Russian characters correctly. There are two ways out of this situation:
  1. Make Windows command prompt display Russian characters correctly. To do this:

    • Change the default command prompt font to something that supports code page 1251 (I use Lucida Console)
    • Issue the following command before launching SQLPLUS:
      chcp 1251
  2. My preferred solution: revert Oracle back to its normal US English self. To do this, change the value of the above registry key to:
    AMERICAN_AMERICA.WE8MSWIN1252

Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home