[fpc-devel] FPC 2.3.1 seems a mixed mess with Unicode support
Jonas Maebe
jonas.maebe at elis.ugent.be
Tue Sep 15 15:01:48 CEST 2009
On 15 Sep 2009, at 14:47, Martin Schreiber wrote:
> On Tuesday 15 September 2009 14:34:52 Jonas Maebe wrote:
>>
>> I don't think that the default source code encoding has ever been
>> changed. And the way to specify it is also quite old already.
>>
> Wasn't a string constant containing a character > #127 treated as
> widestring
> earlier?
I don't think so. There was the following behaviour, but that was a
bug: <http://wiki.freepascal.org/User_Changes_Trunk#Encoding_of_single-character_constants_assigned_to_widestring
>. That change in itself was due to <http://wiki.freepascal.org/User_Changes_2.2.2#Char_to_WideChar_conversions_and_vice_versa
>, but that had nothing to do with Lazarus.
That change dates from August 2007, and was due to <http://bugs.freepascal.org/view.php?id=7758
>. Another thing that was changed at the same time, was that
a) *if* a string was parsed as widestring (e.g., if you have
{$codepage utf-8} and the string has characters > #127),
/and/
b) you directly assigned this constant widestring to an ansistring in
the program
then the compiler would no longer "convert" this constant widestring
to an "ansistring" at compile time, but instead insert a call to the
widestring manager to convert it at run time. The reason was not
Lazarus, but simply because the compiler doesn't have a clue about
what the actual code page of the ansistring will be at run time in the
first place
I believe it just replaced all characters > #127 with '?' at compile
time before.
Jonas
More information about the fpc-devel
mailing list