Recent

Author Topic: A simple sane question to end insanity! TStringList in unicode mode  (Read 24003 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: A simple sane question to end insanity! TStringList in unicode mode
« Reply #60 on: August 19, 2017, 12:39:20 pm »
The wiki page that JuhaManninen refers to is a good starting point but it could be improved: I added a discussion here: http://wiki.freepascal.org/Talk:Unicode_Support_in_Lazarus to this http://wiki.freepascal.org/Unicode_Support_in_Lazarus as a suggestion.
How to answer there? I answer here instead:
Quote
I would propose to restructure this page as follows or to create a new page if necessary for beginners:
Beginners of Lazarus or Unicode? The page is already friendly for Lazarus beginners. Just see the "Usage" section which (I hope) is enough for many users.
Quote
Who is this page for? A brief description of who should be reading this and why.
It is obvious from the title "Unicode Support in Lazarus". Why would you add useless zero-information?
Quote
What is unicode and when to use it: a brief description of the purpose behind unicodes and links to external pages that delve into greater details for those who wish to know more. Mostly, a few guidelines on when to use Unicode and when not to use it.
That page is not the right place to explain what Unicode is. There are plenty of other pages in internet for that.
Yes, links to external pages would be good. Please add them to the "See Also" section.
When to use Unicode? Always. It is enabled by default for GUI apps. Some people may not even realize they use Unicode which means things work well.
Quote
Prerequisites: which version of Lazarus-Ide one should be in to use Unicode.
It is clearly mentioned in the very first "Introduction" section:
 "The Unicode support is enabled automatically since Lazarus 1.6.0 when compiling with FPC 3.0+."
Quote
'Hello World' in Unicode. A sample program showcasing how to use a command-line program in Unicode
It would have nothing specific to Unicode except for "uses LazUTF8" which is already clearly documented.
'Hello World' looks the same with and without Unicode.
Quote
'Hello GUI': a sample application with GUI to showcase how this is done.
It would have absolutely nothing specific to Unicode. Maybe you didn't understand but GUI applications work with Unicode by default. It is transparent and automatic.
Quote
Unicode Standard API: a list of string routines that work out of the box with Unicode when LazUtils is included.
Hmmm... is this the right place for such a list? Maybe. I must think about it.
Quote
Unicode Required calls: a list of ut8 routines that are required to be called with the Utf8 prefix.
That is easy. None of them are required. Many applications do not need them.
Quote
modeswitch Unicodestrings: a discussion on utf-16 versus utf-8. What are the pros and cons of each and when to use which.
Certainly a wrong place for such discussion. The Lazarus solution uses UTF-8, not UTF-16.
There are plenty of discussions and flame-wars about those encodings which is boring because they are both easy to get right if only people concentrated in coding.
"ModeSwitch UnicodeStrings" is mentioned in the FAQ section.
Quote
Where to go from here: a list of useful more in-depth links about unicode
Same as earlier. Add links to "See Also" section.
Quote
You have a question: some advice on how to leverage the forum for questions related to Unicode.
You can mention the forum in "See Also" section although everybody reading the page already knows it.
Quote
In my mind, this is a user-centric approach to documentation instead of an implementation-centric approach that is currently used by the page as it is now.
Nonsense.
Now it is as user-centric as can be. It explains how to use Unicode with Lazarus starting from general cases and going to specific detailed info later.
Earlier there were lots of useless technical details about the implementation and the old LCL Unicode solution. Relevant info was difficult to find.
Some of your suggestions would make it worse again.

[edit]
I replace the Windows API section with "Calling API functions that use WideString or UnicodeString".
I explained it better and added example code. Please take a look.
 http://wiki.freepascal.org/Unicode_Support_in_Lazarus#Calling_API_functions_that_use_WideString_or_UnicodeString
« Last Edit: August 19, 2017, 01:44:51 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

EganSolo

  • Sr. Member
  • ****
  • Posts: 290
Re: A simple sane question to end insanity! TStringList in unicode mode
« Reply #61 on: August 19, 2017, 09:56:01 pm »
JuhaManninen,

Clearly, you (and Thaddy) have a short fuse and you guys tend to resort to ad hominem attacks when you're frustrated.

Instead of replying line-by-line the way you did, take the time to think it through and then all you need to say is this:

"The new proposed structure does not meet my expectations and I think the page as it serves its purpose."

That's all you had to say.

If I disagree, it's on my to write that wiki.

Enough said.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: A simple sane question to end insanity! TStringList in unicode mode
« Reply #62 on: August 19, 2017, 11:13:40 pm »
Instead of replying line-by-line the way you did, take the time to think it through and then all you need to say is this:
"The new proposed structure does not meet my expectations and I think the page as it serves its purpose."
Ok, sorry. I felt like I need to analyse it.

Quote
If I disagree, it's on my to write that wiki.
Yes, you should write a wiki page for people new to Unicode. Don't change the "Unicode Support in Lazarus" page much. You can add links there of course.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

EganSolo

  • Sr. Member
  • ****
  • Posts: 290
Re: A simple sane question to end insanity! TStringList in unicode mode
« Reply #63 on: August 20, 2017, 12:16:24 am »
Glad to know we're on the same page. :) Thanks JuhaMannine for all your support and answers and all the effort you've put into all of this Unicode stuff.

In fact, after seeing how much work you, Thaddy and others have put into this that I got inspired to think about ways to contribute.

 

TinyPortal © 2005-2018