#1 2018-05-18 12:18:19

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Is it possible to change the .pas file format to utf8 instead of ANSI?

Hi ab,

the string constants cannot be displayed correctly on a Windows system that's using a non-ANSI compatible locales, see the screenshot showing the issue:
http://cloud.screenpresso.com/56Xtc/201 … ot.pas.png

I remember the running of mORMot test cases on my Chinese system will emit errors in the JSON testing part, I guess it might be related.

Thanks.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2018-05-18 20:58:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,670
Website

Re: Is it possible to change the .pas file format to utf8 instead of ANSI?

UTF-8 won't work with Delphi 5-7 we still support big_smile so the way to do it is to define pure ascii constant with character number as #number... could you report here the line numbers which need to be changed?
Thanks a lot!

Offline

#3 2018-05-19 06:51:16

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: Is it possible to change the .pas file format to utf8 instead of ANSI?

While merging a GSSAPI pull request non-ASCII chars are converted to ?. Let's keep it with "?" - it is a comments and context is still understandably.

Offline

#4 2018-05-19 07:46:23

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Is it possible to change the .pas file format to utf8 instead of ANSI?

Just like what mpv said, in the mORMot.pas file the garbled characters are only exists in the comments, so maybe it's not worth the change.

What puzzles me is that even I have converted both the SynTests.pas and SynSelfTests.pas files to utf8 encoding from ANSI encoding, when it runs the UTF8 part would still give me many errors, but still I'm using mORMot for years without noticeable errors big_smile


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB