[fpc-devel] Unicode support (yet again)
Felipe Monteiro de Carvalho
felipemonteiro.carvalho at gmail.com
Thu Sep 15 19:00:35 CEST 2011
On Thu, Sep 15, 2011 at 6:01 PM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
> It seems to me, that all of the above functions and classes could be
> solved for applications using UTF-8 ansistrings with a special
> widestring manager and filefunction manager, right?
Theorically, it could, but it would work only in the Ansi RTL,
basically it would not work at all in the Unicode RTL and LCL users
would be locked out of it.
And I say more, two RTLs will immediately cause problems in all kinds
of libraries. Will the FCL work with the Ansi RTL, with the Unicode
RTL, with both? Won't that duplicate the difficulty in maintaining it
if it has to be tested to work in both Ansi and Unicode mode? Will all
packages from FPC work perfectly in both modes? Is that really
feasable? How? {$ifdef UNICODE} everywhere that uses strings?
And what if people start writing packages for the Unicode RTL, without
IFDEFs to be compatible with Ansi, then LCL users cannot use them?
What if you have a package for Ansi and another for Unicode, they
cannot be used at the same time?
This is not a stable solution, for Lazarus I see only 2 stable
solutions assuming that my proposal is completely off the table:
1> Migrate to UnicodeString
or
2> Implement everything that we need in the LCL to substitute RTL
routines which include string or file handling (and we are not really
that far away from finishing that at all...)
Porting all of the libraries and applications which I use for
UnicodeString will likely be so huge of a task that I don't see any
feasability in this kind of thing. We need to port SynEdit, the LCL,
fpvectorial, regexpr... lots of applications which I wrote and nearly
all of them do some kind of text parsing or handling...
Even worse would be keeping all those projects with IFDEF UNICODE
everywhere ... Just imagine how many regressions linked to not testing
both possibilities...
Just implementing ourselves what we need for file handling is orders
of magnitude less work for me, and then Lazarus can work regardless of
which RTL packages rely on, either Ansi or Unicode.
--
Felipe Monteiro de Carvalho
More information about the fpc-devel
mailing list