Re: OemToChar() question



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




.



Relevant Pages

  • Unicode Support
    ... compiler/assembler is unicode support. ... Compilers still require the source code to be 8bit ... valid range of characters to the BMP, ...
    (alt.lang.asm)
  • Re: Use of Unicode in Python 2.5 source code literals
    ... I'm an experienced programmer, but new to Python. ... This question arose when I tried to create a literal in my source code ... Python supports writing Unicode literals in any encoding, ... IDLE won't allow Unicode literals (e.g. characters copied and pasted ...
    (comp.lang.python)
  • Re: weird numbering
    ... > Unicode with wierd results. ... Looking at the source code of, ... These all characters are i-mode gaijis. ...
    (sci.lang.japan)
  • Re: Strange error (visual studio 2003 and envision)
    ... am not missing unicode in identifiers, ... characters in strings in .NET is very important for me. ... understand source code with characters with codes between 0 and 255, ... why we don't accept yet unicode manifest strings. ...
    (comp.lang.eiffel)
  • Re: The standard I/O problems
    ... source code was in seven-bit characters. ... Eddies in the input stream: The input stream, ... strings, MOVE whole strings from place to place, and TYPE strings, then ...
    (comp.lang.forth)