OEM and ANSI

Windows uses two types of encoding.

  • Encoding used for the output of text information into graphical windows. It is known as ANSI encoding.

  • Encoding used for output into console windows. It is also called original equipment manufacturers (OEM) encoding.

I'd like to point out once again that, principally, any encoding system can play the role of ANSI or OEM. The important point here is that Windows uses different code tables for output into GUI windows and for output into console windows. As mentioned previously, code layout for the codes from 0 to 127 is the same for different encodings. Consequently, a problem might arise if the information that you are going to output will contain text in national languages other than English. Windows provides various means of converting text strings from one encoding system to another encoding system. Most frequently, API functions such as OemToChar and CharToOem are used for this purpose. Consider these functions in more detail, since I'll use them extensively later in this book. In C notation, these functions appear as follows :

 BOOL OemToChar (          LPCSTR lpszSrc,          LPTSTR lpszDst     )     BOOL CharToOem (          LPCTSTR lpszSrc,          LPSTR lpszDst     ) 

The OemToChar function converts the string from encoding used for console output into encoding used for GUI output. The CharToOem function carries out the inverse operation. The first argument of both functions is the address of the buffer, where the converted string will be copied . The second argument is the address of the string that has to be converted.



The Assembly Programming Master Book
The Assembly Programming Master Book
ISBN: 8170088178
EAN: 2147483647
Year: 2004
Pages: 140
Authors: Vlad Pirogov

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net