Re: FW: Unicode konversion

From: addison@inter-locale.com
Date: Mon Jul 31 2000 - 15:56:05 EDT


The call to WideCharToMultiByte takes a code page as an argument (if you
leave it blank it uses the default code page).

When you convert a string with Unicode characters to "multi-byte", you are
actually converting it to a legacy, non-Unicode, character set. Only the
characters actually supported by the character set will be converted. All
other characters will turn into "?" (on Western European systems) or
"_" (on Asian systems).

Generally you will only call WCTMB when you wish to display characters in
a command line environment or in a non-Unicode (window type is "A" instead
of "W") window... as on Windows95. If you plan ONLY to target WinNT, I
respectfully suggest you think about strictly using Unicode in your
program.

Side note: if you are seeing black squares instead of "?", your conversion
is working, but you are using the wrong font to display the characters.

Finally: if your program is a command line program, then you can change
the active code page of 'cmd' by using the 'chcp' command. The code page
you use in WCTMB and the code page of your window have to match.

Best of luck,

Addison

===========================================================
Addison P. Phillips Principal Consultant
Inter-Locale LLC http://www.inter-locale.com
Los Gatos, CA, USA mailto:addison@inter-locale.com

+1 408.210.3569 (mobile) +1 408.904.4762 (fax)
===========================================================
Globalization Engineering & Consulting Services

On Mon, 31 Jul 2000, Magda Danish (Unicode) wrote:

>
>
> -----Original Message-----
> From: Tobias Schafhitzel [mailto:Tobias.Schafhitzel@isa-tools.de]
> Sent: Friday, July 28, 2000 11:11 AM
> To: Magda Danish (Unicode)
> Subject: RE: Unicode konversion
>
>
> Dear Magda Danish,
>
> now there's a new problem. I have an UTF-16 Widecharacter string and want to
>
> convert it to Multibyte string. I used the function WideCharToMultibyte. But
> the
> functions converts only the normal ascii characters...even not the
> characters
> like greek or someth. else. I'm working with Windows NT 4.0 . Can you tell
> me
> which paramters i must use for it ?
> When I want to convert a UTF-16 Character greater than 127 the
> WideCharToMultibyte funct. returns 0.
> Can you help me ?
>
> Best Regards,
>
> Tobias Schafhitzel
>
>
> Tobias Schafhitzel <tobias.schafhitzel@isa-tools.de>
> ISA Tools GmbH, Kupferstrasse 36, D-70565 Stuttgart
>



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:06 EDT