Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unicode char-s on control

7 views
Skip to first unread message

Tumurbaatar S.

unread,
Sep 27, 2006, 12:37:58 PM9/27/06
to
Hi!
I'm trying to write my first international app in BCB6.
It seems there's no way to display Unicode char-s that
do not belong to any charset/code page (like Windows-1251 and etc).
The Text and Caption properties accept only AnsiString string, so
Unicode char-s are not allowed.
Yes?

P.S. VS.NET can display Unicode text on its controls. Is it a .NET
feature?


Alan Bellingham

unread,
Sep 27, 2006, 1:50:42 PM9/27/06
to
"Tumurbaatar S." <spam_...@magicnet.mn> wrote:

>I'm trying to write my first international app in BCB6.
>It seems there's no way to display Unicode char-s that
>do not belong to any charset/code page (like Windows-1251 and etc).
>The Text and Caption properties accept only AnsiString string, so
>Unicode char-s are not allowed.

As far as I am aware, VCL doesn't support Unicode. Which is another
strike against it, in my opinion.

>Yes?
>
>P.S. VS.NET can display Unicode text on its controls. Is it a .NET
>feature?

No, so long as you can get the window handle (which is achievable in
VCL, if I remember correctly), you just use SetWindowTextW() rather than
SetWindowTextA().

Alan Bellingham
--
ACCU Conference: 11-14 April 2007 - Paramount Oxford Hotel

Lesley Anne

unread,
Sep 27, 2006, 4:07:22 PM9/27/06
to
"Tumurbaatar S." <spam_...@magicnet.mn> wrote in message
news:451a...@newsgroups.borland.com...

> Hi!
> I'm trying to write my first international app in BCB6.
> It seems there's no way to display Unicode char-s that
> do not belong to any charset/code page (like Windows-1251 and etc).
> The Text and Caption properties accept only AnsiString string, so
> Unicode char-s are not allowed.
> Yes?

Even though Text and Caption properties are listed as being AnsiString, you
can assign WideString values to them as well, since the implementation of
the AnsiString type isn't limited to single byte encodings. Unfortunately,
I haven't been able to find a way to make them actually display correctly
when given Unicode values higher than 0x00FF. The implementation of the
display doesn't seem to have been done correctly.

There are, however, third-party component libraries available to take up the
slack. The one I've heard about the most often (though I haven't used it
myself) is TNT.
http://www.tntware.com/delphicontrols/unicode/
From the looks of it, you simply replace your TLabel's with TTntLabel's,
TEdit's with TTntEdit's, etc. and then you can use Unicode values and have
them display correctly, while keeping the ease-of-use of the VCL.


Tumurbaatar S.

unread,
Oct 8, 2006, 10:44:32 PM10/8/06
to
Thank you!

> No, so long as you can get the window handle (which is achievable in
> VCL, if I remember correctly), you just use SetWindowTextW() rather than
> SetWindowTextA().
>

What about controls that have multiple items with text properties,
e.g. TGrid/TDBGrid, TListView and etc?


Tumurbaatar S.

unread,
Oct 8, 2006, 10:40:35 PM10/8/06
to
Thank you, all!
Ok, so I can manually or thru 3rd party controls manage Unicode char-s
for the controls. Is this true for database controls? I'm planning to use MS
SQL2K with
NVARCHAR string columns and TADOXXX controls. Can TADOXXX components
read/write Unicode text?


"Lesley Anne" <mspfi...@yahoo.com> wrote in message
news:451ada0d$1...@newsgroups.borland.com...

0 new messages