[DUG] Unicode [redux]

Todd Martin todd.martin.nz at gmail.com
Thu Oct 15 23:28:24 NZDT 2009


Hi Jolyon

> The problem is that what we're stuck with is a mess, so all we can do is
> talk about the mess as a way of finding our way out of it (in the sense that
> by talking about the mess we might one day understand the mess well enough
> to be able to live with it).

You're fast putting me off upgrading.

> i.e. a new user coming to Delphi 2009/2010 for the first time is going to
> have a hard time understanding even the simplest things, such as why
> ANSIUppercase() takes a UnicodeString parameter let alone treats it as
> Unicode whilst Uppercase() also takes a UnicodeString yet treats it as
> ASCII.
> 
> Why isn't there simply:
> 
>   Uppercase(ANSIString)
>   Uppercase(UnicodeString)
>   Uppercase(WideString)
> 

Looking at Delphi 6 I see the problem. AnsiUpperCase is defined as
function AnsiUpperCase(const S: string): string;
when it should have been defined as
function AnsiUpperCase(const S: Ansistring): Ansistring;

So I'm wondering if patching the VCL with such declarations might make
things clearer. Likewise for Uppercase();
I don't see how Uppercase(UnicodeString) or Uppercase(WideString) makes
any sense?

I'm also wondering what the {$H–} compiler directive does now? Does it
turn a Unicode string into a ShortString?

Todd.




More information about the Delphi mailing list