Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-05

Wiki page "Unicode Support in Lazarus" improved

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Werner Pamler
to Juha Manninen
Juha Manninen wrote 8 lines
I have simplified and improved the page http://wiki.freepascal.org/Unicode_Support_in_Lazarus I tried to move relevant information to the top and remove duplicate information. For example there is a short "Usage" section with simple rules and then: "These rules make most code already compatible with Delphi." which is pretty much what most people need to know.

* In section "Usage", "For string literals to work the source files must have UTF-8 encoding." - Add: "This is the default for source files written by Lazarus" - Otherwise people will begin to unnecessarily add these "$codepage utf8" directives.
* In section "CodePoint functions for encoding agnostic code" I am missing information on how "ch" is to be declared (in my test: ch:char and ch:string are working; ch:widechar does not).
* Good that the new page appears also in place of the old "Better Unicode Support..." page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170513/aa25c4ac/attachment.html>

Reply by email

Sven Barth
to Werner Pamler

Am 13.05.2017 17:57 schrieb "Werner Pamler via Lazarus" <

Show quoted text 5 lines
: Am 13.05.2017 um 15:17 schrieb Juha Manninen via Lazarus: > > I have simplified and improved the page

http://wiki.freepascal.org/Unicode_Support_in_Lazarus I tried to move relevant information to the top and remove duplicate information. For example there is a short "Usage" section with simple rules and then: "These rules make most code already compatible with Delphi." which is pretty much what most people need to know.

In section "Usage", "For string literals to work the source files must

have UTF-8 encoding." - Add: "This is the default for source files written by Lazarus" - Otherwise people will begin to unnecessarily add these "$codepage utf8" directives.

Warning: the compiler does *not* consider the file as UTF-8 without a BOM or a set codepage!

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170513/0a928895/attachment.html>

Reply by email

Juha Manninen
to Werner Pamler: * In section "Usage", "For string literals to work the source files must have UTF-8…
Werner Pamler wrote
In section "Usage", "For string literals to work the source files must have UTF-8 encoding." - Add: "This is the default for source files written by Lazarus" - Otherwise people will begin to unnecessarily add these "$codepage utf8" directives.

Actually that was one more duplicate information and in a wrong place. It is explained in "String Literals" section.
It is not part of simple rules because it happens automatically by default. Thanks for noticing.
It appears to be more difficult to remove old text than to write new text. Don't know why...

In section "CodePoint functions for encoding agnostic code" I am missing information on how "ch" is to be declared (in my test: ch:char and ch:string are working; ch:widechar does not).

I added variable types to the example.
I plan to improve the codepoint section more.
I will replace the page UTF8_strings_and_characters with a similar page that uses the LazUnicode encoding agnostic functions. Then the whole thing will be as Delphi compatible as possible.

Juha

Reply by email

Juha Manninen
to Sven Barth: Am 13.05.2017 17:57 schrieb "Werner Pamler via Lazarus" <…
Sven Barth wrote
Warning: the compiler does *not* consider the file as UTF-8 without a BOM or a set codepage!

Yes but that is a very misleading warning.
The whole thing works without a BOM better than with it because of the "double cheat". See "String Literals" section for details. It is counter-intuitive and most people can just ignore it.

With BOM it did not work for codepoints beyond BMP but that was fixed and backported to FPC 3.0.3, right?

Juha

Reply by email