[icq-devel] ??? 16-bit Unicode Chars & Delphi ???

Remy Lebeau gambit47 at yahoo.com
Wed Jun 26 22:12:15 CEST 2002

--- icq2000cc <icq2000cc at hobi.ru> wrote:

> When I receiving a ROSTER, some NickNames
> are represented as 16-bit Unicode chars (?)
> or as WideChar chars(?).

WideChar and Unicode are the same thing, as far as
actual memory for the characters is concerned.

However, nicknames are always in 8-bit ANSI
characters, not 16-bit UNICODE characters.  Whatever
client the other person used, if they did indeed input
a true 16-bit nickname into the user interface, it
would still have to be translated to 8-bit for ICQ's
actual use.

> I tryed to use a lot of delphi-function.
> The result is zero.

Could you be more specific?

> How can I do it?

What you can try doing is treat the nickname as 8-bit
initially, then you can scan through the characters in
a loop looking for any that are above ASCII 128, and
if found then assume 16-bit (if the string's length is
divisible by 2 evenly, that is).  Or else, just forget
worrying about supporting 16-bit and leave it as 8-bit
always, it won't hurt anything especially if you're
using it for display purposes only.

However, I should point out that the fact that you're
using Delphi means that you're also using the VCL,
most likely.  The VCL does not natively support
displaying UNICODE data.  Even if you do manage to
determine whether the nickname is 8-bit or 16-bit, the
VCL itself will only allow you to display it as 8-bit
regardless, unless you find third-party UI controls
that natively support 16-bit UNICODE displays.


Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

More information about the icq-devel mailing list