Re: Why use the unicode version of the api?
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 7 Dec 2005 14:27:43 -0000
What you're doing will work well as long as you're only operating in one
locale Gustavo, e.g. Korean.
Unicode only becomes important if your code, or data, are spanning multiple
locales. For instance, if your registry happened to contain both Korean and
Japanese data then the ansi API version will not cope with both types of
data.
There may also be a slight performance issue. For instance, the registry
holds its data internally in Unicode, and VB uses Unicode strings. Hence,
using the 'W' API forms instead of the 'A' forms would bypass any
translation to an intermediate "ANSI" form. Note that this isn't true of all
'W' APIs though. It depends on where the data originate since Windows
doesn't use 100% Unicode.
Tony Proctor
"Gustavo Echevarria" <g.echevarria@#REMOVETHIS#lantek.es> wrote in message
news:##GJvRz#FHA.208@xxxxxxxxxxxxxxxxxxxxxxx
> hello again
> i've use the ansi version in a dbcs korean system with a string in korean
> and sames to functions good. Can someone know what are the problems with
> this api 32 unicode funcion? why is necesary to use them in an aplication
> programming?
> Thanks in advanced
> Gustavo Echevarria
>
> "Thorsten Albers" <albersRE@xxxxxxxxxxxxxxxxxxx> escribió en el mensaje
> news:01c5eba4$e2b1e380$b38ee684@xxxxxxxxxxx
> > Gustavo Echevarria <g.echevarria@#REMOVETHIS#lantek.es> schrieb im
Beitrag
> > <#UMiMt56FHA.2036@xxxxxxxxxxxxxxxxxxxx>...
> >> i have a question regarding the two different versions of the win32
apis
> > of
> >> some functions. For example RegQueryValueExW and RegQueryValueExA. Can
i
> > use
> >> any of them in a chinesse operation system?. What problems can i have
in
> >> those dbcs systems?
> >
> > With the "W" version you will get the Unicode text. With the "A" version
> > you will get the Unicode text converted to ANSI text. But: ANSI is a
> > character encoding supporting only 255 characters (1 byte per
character),
> > Unicode uses 2 bytes per character thus supporting at least 65536
> > characters (with the so-called surrogates it is more then 65536). For
some
> > Unicode codepoint ranges the 256 characters are sufficient, but for most
> > of
> > them they are not since most writing systems are using more then 256
> > characters.
> > On a japanese and chinese version of windows the ANSI functions do
support
> > DBCS ANSI strings with a mixture of one or two bytes per character
> > (handled
> > by the use of so-called lead bytes). But AFAIK this isn't valid for
other
> > writing systems that are using more then 256 characters, i.e. DBCS with
> > "A"
> > functions is restricted to japanese and chinese. So, if not used
> > explicitely for japanese or chinese writing system strings, using the
"A"
> > version would result in information loss.
> > And DCBS ANSI strings are not easy to handle, Unicode strings clearly
are
> > the better choice. DCBS is the past, Unicode is the future...
> > If you want to use DCBS in your application, of course you should use
the
> > "A" function versions, or, IMHO better, you should use the "W" versions
> > and
> > map the Unicode strings with MultiByteToWideChar()/WideCharToMultiByte()
> > from or to DBCS ANSI strings.
> >
> > --
> > ----------------------------------------------------------------------
> > THORSTEN ALBERS Universität Freiburg
> > albers@
> > uni-freiburg.de
> > ----------------------------------------------------------------------
> >
>
>
>
.
- References:
- Re: Why use the unicode version of the api?
- From: Gustavo Echevarria
- Re: Why use the unicode version of the api?
- Prev by Date: Re: Why use the unicode version of the api?
- Next by Date: Re: How to send mail using VB?
- Previous by thread: Re: Why use the unicode version of the api?
- Index(es):
Relevant Pages
|