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
> 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
---
> 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
---
Be aware that only 12 Unicode-WinAPI-Functions are working unter
Win9x/ME. All other are only Dummy's.
> Have a WideString-Enabled Stringlist.
Delphi 2006 has a TWideStringList type also. Declared in
WideStrings.pas in the RTL\Common folder.
> 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
---