[fpc-devel] ccharset.pas, charset.pas and strings/unicode ?

Marco van de Voort marcov at stack.nl
Thu Apr 7 10:12:06 CEST 2011


In our previous episode, Skybuck Flying said:
> Suppose some kind of weird dissaster happens, like tsunami in japan... all 
> our computers are destroyed...

(Then recompiling free pascal is the least of our problems)
 
> What would happen if the compiler was unicode only ?
> 
> Could the compiler still be build ? I would guess so... unless it depends on 
> some ansi strings in assembly or so...

This is a very complicated situation, and such questions are not answerable,
since everything depends on boundery problems.

The easiest would probably be to go back in time and research when
development systems migrated from local computer encodings to a standarised
characterset (ansi). Since unicode mostly only increases the charset, it is
less of a revolution than ansi was.
 
> Furthermore what happens to statements/code like this:
> 
> SomeString := 'SomeText';
> 
> I think in a unicode compiler 'SomeText' might actually be defaulted to 
> unicode ?

Source code encoding and runtime encoding are two different things. In e.g. 
recent Delphis, the source code encoding (including such strings) is UTF8,
while the runtime library encoding is UTF16.

In general, your questions suffer from oversimplifications that make them
unanswerable or not really a problem.

As far as bootstrapping is concerned, such problems were very interesting in
the seventies and eighties, and is considered mostly solved nowadays. The
bootstrapping problem is a general problem for any compiler, not just
freepascal.

For some details of FPC's bootstrapping buildup have a look at the buildfaq:

http://www.stack.nl/~marcov/buildfaq/
 



More information about the fpc-devel mailing list