Ansi Example

File: Examples\Ansi\DKLang_Ansi_Demo.dpr

This example resembles Simple one except that it uses only conventional VCL controls instead of Tnt Unicode Controls so it can't correcty display any interface language with character set other than currently set default for non-Unicode programs.

Notice that the following line causes implicit Unicode-to-ANSI conversion:

cbLanguage.Items.Add(LangManager.LanguageNames[i]);

This is because LangManager.LanguageNames[] returns a WideString while cbLanguage.Items.Add() takes an AnsiString as an argument. Implicit WideString to AnsiString and back conversions always use system default code page set for Unicode-unaware software (configured in Regional Settings application of Control Panel). This is the best what we might do here because language names returned by LangManager.LanguageNames[] are also taken from the system, being produced in the current interface language. There's a good chance this language is the same as language being used for non-Unicode programs, but if they differ, we again can't ensure language list is displayed correctly.