Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Jolyon Smith <jsmith@xxxxxxxxxxxxx>
- Date: Fri, 14 Mar 2008 10:40:07 +1300
In article <xn0fnn74c2d5ba200fnewsgroups@xxxxxxxxxxxx>,
newsgroups@xxxxxxxxxxxx says...
[*] Not quite sure, but I think this should be enough to make the code
fully Ansi. Did I forget something? If this is really all that is
needed, it could be a batch process.
No, not quite, because the VCL is still Unicode so your application will
now accept input that it previously did not.
There are two aspects to the problem:
1) The need to "Run To Stand Still" - i.e. for existing ANSI based code
to continue to safely run in an "ANSI world"
2) The idea that "supporting Unicode" is a simple case of changing from
ANSI strings (and APIs) to Unicode ones.
The obsession with propogating the myth of (2) is what has created (1).
Given that whatever the implementation details, CodeGear seem intent to
try to keep some compatability with existing applications I consider it
behoven on them to give priority to the needs and concerns of the
developers and users of those applications, rather than taking a route
which may make it easier for them.
(For sure, if it's easier for them then the users get SOME benefit
(faster delivery etc) but the question is whether that benefit is worth
the COST)
And every API call should explicitly call the -A version,
Why?
Why can we not have overloaded WinAPI declarations that bind to specific
A/W imports?
procedure Foo(aStr: PANSIChar); overload; external DLL name 'FooA';
procedure Foo(aStr: PWideChar); overload; external DLL name 'FooW';
This compiles perfectly fine, but maybe it doesn't work correctly for
some reason (have not got as far as a compiling and running test case.
And look at that! You don't even need a switch based directive to
"choose" the A/W API, you get the API appropriate to the sype of the
parameters you pass.
So if you DO have a switch that would enable "String" to mean
"ANSIString" in one unit and "UnicodeString" in another unit, each of
those units might contain code that references some API for which A and
W variants exist, and each will bind to the correct import at compile
time.
I thought this stuff was impossibly hard?
;)
.
- Follow-Ups:
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Paul Scott
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Rudy Velthuis [TeamB]
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- References:
- Suggested Alternative Unicode Implementation (for Rudy+ misc others)
- From: Jolyon Smith
- Re: Suggested Alternative Unicode Implementation (for Rudy+ misc others)
- From: Kostya
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Kostya
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Rudy Velthuis [TeamB]
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: ozbear
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Rudy Velthuis [TeamB]
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Paul Scott
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Rudy Velthuis [TeamB]
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Paul Scott
- Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- From: Rudy Velthuis [TeamB]
- Suggested Alternative Unicode Implementation (for Rudy+ misc others)
- Prev by Date: Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- Next by Date: Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- Previous by thread: Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- Next by thread: Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
- Index(es):
Relevant Pages
|
Loading