Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Windows, when entering characters using ALT+nnn, which character encoding is being used? And when entering characters with ALT+0nnn, which character encoding is being used? And how do these answers depend on Windows' language and input method settings, if at all? And is it always the case that the codes repeat after 255?

I've found multiple websites with information that's confusing, outdated, possibly language-specific or just wrong. And despite this being a well-known and widely-used Windows feature, I can't seem to find any reasonable official documentation on it.

share|improve this question

1 Answer 1

I believe these shortcuts depend on the libraries used by specific programs such as Word, Excel and Notepad. References to Alt character codes at microsoft.com are always in the context of a specific application or suite.

The character resulting from Alt+nnn ought not to depend on any IME but should respect document, application or Windows language settings that determine the default code page currently in use.

Microsoft are cavalier in their use of terms like ASCII and ANSI, documentation of Alt+nnn reflects that.

Here's a little experiment in the Command Prompt on Vista

c:\>chcp 437
Active code page: 437
c:\>rem alt+224 α
c:\>rem alt+0224 à

c:\>chcp 869
Active code page: 869
c:\>rem alt+224 ζ
c:\>rem alt+0224 à
c:\>rem alt 0137 ‰

After adding a Greek keyboard layout in Control panel, and choosing Greek from the language bar, an experiment in WordPad, showed that ALt+0224 then produces ΰ from Code Page 1253 (modern Greek) and Alt+224 produces Σ (though I haven't discovered which DOS/OEM code page that implies)

From which I deduce that

  • Alt+nnn is always the current DOS (also called OEM) code page
  • Alt+0nnn is always the current Windows code page
  • the above differ
  • the language bar can be used to change these.

At least for the programs I tried.

share|improve this answer
    
I'd say it's very doubtful that this is actually implemented by the programs themselves. Rather, it's probably implemented by some of the underlying UI primitives, such as the Edit control. Just testing around in various places in the current UI, I find that any place I can place a cursor, I can make use of the alt method for entering chars. If you look at the documentation for the Rich Edit Control, you'll see the Alt+Numpad shortcut, and a few others related to it. msdn.microsoft.com/en-us/library/windows/desktop/… –  Svend Oct 20 '11 at 13:26
    
@Svend: I believe you are right, I'll amend my answer accordingly. However not all Windows applications make use of the same libraries and controls. An obvious and unsurprising example would be third-party applications such as gVim. It is not inconceivable to me that there might be differences between applications that use commctrl.dll, comctl32.dll, MFC and .Net or OWL, VCL etc. –  RedGrittyBrick Oct 20 '11 at 13:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.