Forum > LCL

TEdit.PasswordChar should be of type WideChar

<< < (2/4) > >>

Thaddy:

--- Quote from: 440bx on January 29, 2022, 12:06:35 am ---
--- Quote from: Alextp on January 28, 2022, 11:18:38 pm ---Why is it critical, that this is Char? What will your application loose?

--- End quote ---
For instance, when trapping one of more APIs in some DLL - a system DLL or some application's DLL - all the exported (and imported) names are in char not widechar.  That's the most common instance but, in spite of what MS says, there are a fair number of strings/identifiers in the system that are char, not widechar.

Unicode is fine and useful for user interfaces and other things that may need to be translated to other languages but, at the system level it's crucial to be able to use char - most likely because the PE format is char based not Unicode based.

--- End quote ---

Mis-use of char detected, what you mean is byte sized AnsiChar? Depending on mode you confuse people by insisting "char". That is actually C'ism.
(I know it is not ideal, but Freepascal allows for de-contamination of such folly)

engkin:

--- Quote from: Zoran on January 29, 2022, 01:46:32 am ---Any unicode character should be allowed, widechar is not the solution.
LCL uses UTF-8, so it should be utf-8 encoded (so, a string). Some program control should exist in property setter, which checks that only strings which represent one utf8 encoded character are allowed -- Utf8Length must return 1.

--- End quote ---

Why limit UTF8Length to 1?

Thaddy:
Indeed, can be 4.

Bart:
The API actually accepts PassWordChar to be (when translated to UTF8) 4 codepoints wide?
(Or do the 4 codepoints then make up one grapheem?)

Bart

440bx:

--- Quote from: Thaddy on January 29, 2022, 08:22:27 am ---Mis-use of char detected, what you mean is byte sized AnsiChar? Depending on mode you confuse people by insisting "char". That is actually C'ism.
(I know it is not ideal, but Freepascal allows for de-contamination of such folly)

--- End quote ---
No Thaddy, it's a history-ism.  char has been the single byte character type for I'm not sure how many decades but definitely a good bit more than the yuppie ansichar and widechar.

One of the things I like best about Freepascal is that when I declare a variable to be of type "char" it's actually of type "char" ...Wow!!  Amazing, they still make compilers that parse by the rules.

Thank God for breathable air, underwear, women and the single byte character type.



Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version