[fpc-devel] Unicode in the RTL (my ideas)
graemeg.lists at gmail.com
Tue Aug 21 10:51:16 CEST 2012
On 20 August 2012 23:18, Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
> The Delphi developers wanted to implement what you suggest, but dropped that
> approach later again.
When Embarcadero implemented Unicode support, Delphi was a pure
Windows application. They had no need to think of anything other than
what Windows supports. Not to mention that they were on a tight budget
and time constraint, because every minute they waisted, they lost
clients moving to more "up to date" compilers and languages. So it was
all about getting something out as quickly as possible, and probably
cutting corners where possible.
> A character type is somewhat useless, unless all strings are UTF-32 (what's
> quite unlikely now). Instead substrings should be used, which can contain
> any number of bytes or characters.
I guess that depends on how you define the Char type. Is it meant to
hold a single Unicode codepoint, or a single printable character. If
the latter, then probably a bigger Char type is required.
> You also have to explain what String means in an Unicode environment.
The String syntax in Object Pascal means you are defining a
shortstring type (irrespective of compiler mode), thus an array of
bytes. In this case 4-bytes are used to hold any Unicode codepoint.
> Q: Did you ever read about the new string implementation of FPC?
I have read some of the message threads that went around in fpc-devel,
I also worked on the cp branch before it was merged with Trunk. If you
have any other "documentation" in mind, please post the URL and I'll
happily take a look.
- Graeme -
fpGUI - a cross-platform Free Pascal GUI toolkit
More information about the fpc-devel