[Lazarus] String vs WideString
Tony Whyman
tony.whyman at mccallumwhyman.com
Mon Aug 14 16:11:15 CEST 2017
On 14/08/17 14:46, Mattias Gaertner via Lazarus wrote:
>> You made need UTF-16/Unicode support for accessing Microsoft APIs but
>> apart from that, why is it being promoted as the universal standard?
> Who does that?
>
> Mattias
Because the obvious implication when someone argues against AnsiString
(from which UTF8String derives) and talks about Unicode is that they are
promoting UTF-16 and the UnicodeString type. Perhaps this is because I
am old enough to remember when MS first added wide characters to Windows
and that they called it "Unicode". To me, when people say "Unicode" they
mean Windows wide characters.
Perhaps the problem is the use of the word "Unicode". By trying to
embrace UTF8, UTF16 and UTF32 with the older UCS-2 it is perhaps too
ambiguous a term - especially as the Delphi/FPC UnicodeString type
exists and probably (but I'm not certain) means UTF-16.
What I see in FPC/Lazarus today is:
- UTF8 supported through AnsiString.
- A confusion of Widestring/UnicodeString for UTF-16 and legacy UCS-2.
- Nothing for UTF-32.
If nothing else, FPC Lazarus could do with a clean-up of both
terminology and string types. Indeed, why isn't there a single container
string type for all character sets where the encoding whether a legacy
code page, UTF8, UTF16 or UTF32 is simply a dynamic attribute of the
type - a sort of extended AnsiString?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170814/38f36890/attachment.html>
More information about the Lazarus
mailing list