[fpc-pascal] JSON and UTF8

Michael Van Canneyt michael at freepascal.org
Tue Jul 10 09:59:33 CEST 2012

On Tue, 10 Jul 2012, Ludo Brands wrote:

>> Following up on bug 22310 http://bugs.freepascal.org/view.php?id=22310
>> I enabled the use of UTF8 in the FPC JSON support.
>> The constructors of the JSON parser/scanner now accept an
>> extra argument
>> UseUTF8 which tells them to convert JSON strings to UTF8, not
>> the system codepage.
> I don't understand why you want to keep buggy behavior for backwards
> compatibility.

Because the old behaviour is not "buggy".

It simply did not support Unicode, and does the next best thing, 
in casu: it transforms to the system codepage.

A car without ABS and SAT-Nav is not buggy. 
It just doesn't support features which are nowadays called standard.
You can perfectly drive it.

Just as Unicode is nowadays standard, N years ago, it was not.

Since backwards compatibility is very important, we must offer the option.


More information about the fpc-pascal mailing list