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

Unicode operations

19 views
Skip to first unread message

Ian R

unread,
Apr 14, 2006, 10:18:48 AM4/14/06
to
I would like to support unicode in an application. I do have components
which are able to display Unicode text, but I need assistance on the way to
translate some operations from AnsiString to WideString.

For example, I use TStringList extensively. Is there a version of
TStringList that supports Wide Strings or even better UTF-8 encoded strings?
I am especially concerned with the proper sorting and searching. I can of
course create my own, but I'm sure someone already did this.

What about isCharAlpha? Is there a similar function for Wide Strings. If
not, any suggestion on how to tokenize a long wide strings into a series of
words?

What about basic operations like Copy, Pos,

Any document that can provide me with information on the handling of either
Wide Strings or UTF-8 encoded strings?

Ian


danny heijl

unread,
Apr 14, 2006, 12:54:20 PM4/14/06
to
Ian R schreef:

> I would like to support unicode in an application. I do have components
> which are able to display Unicode text, but I need assistance on the way to
> translate some operations from AnsiString to WideString.
>
> For example, I use TStringList extensively. Is there a version of
> TStringList that supports Wide Strings or even better UTF-8 encoded strings?
> I am especially concerned with the proper sorting and searching. I can of
> course create my own, but I'm sure someone already did this.

If you use the Tnt components you have everything you need in
TntClasses.pas.


> What about basic operations like Copy, Pos,

From at least D5 onwards a number of these functions are overloaded to
work on UCS2 strings.

Danny
---

Ian R

unread,
Apr 14, 2006, 1:27:16 PM4/14/06
to
What about isCharAlpha, which is the most important one for me for now?


Bernhard Geyer

unread,
Apr 14, 2006, 4:12:28 PM4/14/06
to
I would recomend ElPack (http://www.lmd.de/products/lmdelpack/).
Supports Unicode from Win95 and later. Have a WideString-Enabled
Stringlist. For UTF8Coding/Encoding Delphi have functions in System.pas
UTF8Decode/UTF8EnCode.

danny heijl

unread,
Apr 15, 2006, 5:40:14 AM4/15/06
to
Ian R schreef:

> What about isCharAlpha, which is the most important one for me for now?

That one is in the Windows API (user32.dll) both in Ansi and Unicode
versions (IsCharAlphaA and IsCharAlphaW).

function IsCharAlphaW(ch: WideChar): BOOL; stdcall;
external 'user32.dll';

Danny
---

Bernhard Geyer

unread,
Apr 16, 2006, 3:43:59 AM4/16/06
to
> That one is in the Windows API (user32.dll) both in Ansi and Unicode
> versions (IsCharAlphaA and IsCharAlphaW).

Be aware that only 12 Unicode-WinAPI-Functions are working unter
Win9x/ME. All other are only Dummy's.

JED

unread,
Apr 17, 2006, 7:31:40 PM4/17/06
to
Bernhard Geyer wrote:

> Have a WideString-Enabled Stringlist.

Delphi 2006 has a TWideStringList type also. Declared in
WideStrings.pas in the RTL\Common folder.

--
http://www.jed-software.com
http://jedqc.blogspot.com

danny heijl

unread,
Apr 18, 2006, 5:30:24 PM4/18/06
to
JED schreef:

> Delphi 2006 has a TWideStringList type also. Declared in
> WideStrings.pas in the RTL\Common folder.

It had some issues in D2005, like not using wide strings at all for some
functions, and I don't know if they have all been fixed in D2006, there
was a message in the TNT message board some time ago but the server
seems to be down now.

If in doubt use the TNT version (TTntWideStringList).

Danny
---

0 new messages