On Sat, 31 Aug 2019, Michael Van Canneyt via lazarus wrote:



On Sat, 31 Aug 2019, Anthony Walter via lazarus wrote:

Okay, going back and looking through the messages I see you did post a test
with:

{$codepage UTF8} and uses cwstring

Here are the results with that added:

On Linux using {$codepage UTF8} by itself causes both tests to fail. Adding
cwstring causes both tests to work. On Windows trying to use cwstring
causes the compilation to fail, but with {$codepage UTF8} added the tests
work. I will try a few more tests, but there should be an "out of the box"
option to get FPJson working without the need to add ifdefs along with
extra directives added outside of the FPJson units themselves.

Glad you picked it up.

See my other mail for more details.

Bottom line:
You simply cannot ignore this. Doing so is asking for problems.

It may work for you, but fail for someone else, and then you'll be
scratching your head as to "why on earth doesn't it work?"

One last thing.

Lazarus includes cwstring by default:

interfaces/carbon/interfaces.pas:  {$IFNDEF DisableCWString}cwstring,{$ENDIF}
interfaces/cocoa/interfaces.pas:  {$IFNDEF DisableCWString}cwstring,{$ENDIF}
interfaces/gtk2/interfaces.pas:{$IFDEF UNIX}{$IFNDEF DisableCWString}uses 
cwstring;{$ENDIF}{$ENDIF}
interfaces/gtk3/interfaces.pp:  {$IFDEF UNIX}{$IFNDEF 
DisableCWString}cwstring,{$ENDIF}{$ENDIF}
interfaces/qt5/interfaces.pp:  {$IFDEF UNIX}{$IFNDEF 
DisableCWString}cwstring,{$ENDIF}{$ENDIF}
interfaces/qt/interfaces.pp:  {$IFDEF UNIX}{$IFNDEF 
DisableCWString}cwstring,{$ENDIF}{$ENDIF}

If you look in the code, you'll see that it handles codepages explicitly in
many places.

Just to corroborate that ignoring this is not an option, and that lazarus
goes to great lengths to make it easier on people.

Michael.
--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to