[Lazarus] Wiki page "Unicode Support in Lazarus" improved

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Wiki page "Unicode Support in Lazarus" improved

Free Pascal - Lazarus mailing list
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.

Please check.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Wiki page "Unicode Support in Lazarus" improved

Free Pascal - Lazarus mailing list
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.
  • 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Wiki page "Unicode Support in Lazarus" improved

Free Pascal - Lazarus mailing list

Am 13.05.2017 17:57 schrieb "Werner Pamler via Lazarus" <[hidden email]>:
>
> 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


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Wiki page "Unicode Support in Lazarus" improved

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, May 13, 2017 at 6:55 PM, Werner Pamler via Lazarus
<[hidden email]> 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
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Wiki page "Unicode Support in Lazarus" improved

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, May 13, 2017 at 7:56 PM, Sven Barth via Lazarus
<[hidden email]> 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
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Wiki page "Unicode Support in Lazarus" improved

Free Pascal - Lazarus mailing list

Am 13.05.2017 19:45 schrieb "Juha Manninen via Lazarus" <[hidden email]>:
> With BOM it did not work for codepoints beyond BMP but that was fixed
> and backported to FPC 3.0.3, right?

Correct.

Regards,
Sven


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus