[fpc-devel] Is calling the Windows Unicode APIs really faster than the ANSI API's?

Michael Schnell mschnell at lumino.de
Mon Sep 29 09:22:14 CEST 2008


>> I don't think,  full UTF-16 really would be desirable desirable over UC-2.
>>
>> Imagine you have a string of some million characters (e.g. a Book). All 
>> functions that need to find the n-th character (like x[n], copy, ...) 
>> would take forever, as they need to scan the complete string (if not 
>> widestring is a rather complex tree-like format).
>>     
>
> That is a solution to isolate such code and treat it different from the
> rest, not to mutilate the unicode standard.
>   
I just checked Turbo Delphi (which does have WideString operations, but 
e.g. TMemo works just on normal strings, so WideStrings are concerted to 
plain old ANSI strings when used with TMemo.Lines) on that behalf:

sizeof WideChar in fact is 2 (16 Bits).

Dumping a WideString shows that in fact the storage area of WideString 
an array of 16 bit WideChars.

So WideString just uses UC2 (and not Unicode).

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20080929/863654a9/attachment.html>


More information about the fpc-devel mailing list