Re: OemToChar() question
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 17:12:05 -0700
Jeff McKay wrote:
> Does anyone know how this API works, or have source code for it?
> Will it act differently
> depending on what hardware it is running on, or Windows version?
> Right now I use it to convert
> text that has various european characters in it (not exactly sure what
> codepage) and it works well,
> except with the euro currency sign. My source documents, for some
> reason, represents the euro
> as a 3 byte unicode sequence. OemToChar does not handle this. I
> could deal with it on my own,
> but I still need to call OemToChar for the rest of the text, and it
> will mess up my converted euro
> character (80h). So I thought I should just do everything OemToChar
> does in my own code.
OemToChar is equivalent to calling MultiByteToWideChar with CP_OEMCP (code
page 437) as the source code page when converting to Unicode characters.
(i.e. if UNICODE is #defined so you're really calling OemToCharW).
When working with single-byte characters (UNICODE not defined, so you're
really calling OemToCharA), the function does a simple 1 for 1 replacement
of characters in the source set with characters from a mapping table.
Multibyte characters will not be converted correctly in this case.
Sounds like you need to be working in Unicode.
-cd
.
- Follow-Ups:
- Re: OemToChar() question
- From: Norman Diamond
- Re: OemToChar() question
- From: Carl Daniel [VC++ MVP]
- Re: OemToChar() question
- References:
- OemToChar() question
- From: Jeff McKay
- OemToChar() question
- Prev by Date: OemToChar() question
- Next by Date: Re: OemToChar() question
- Previous by thread: OemToChar() question
- Next by thread: Re: OemToChar() question
- Index(es):
Relevant Pages
|