Forum > LCL

TEdit.PasswordChar should be of type WideChar

(1/4) > >>

AlexTP:
I'd suggest to change Char type to WideChar. This will allow ppl to apply 'nice unicode thick dot' characters or even 'square' chars.
The LCL change will be easy.
Widgetsets will need only small changes.
Can I prepare the patches?

440bx:

--- Quote from: Alextp on January 28, 2022, 09:23:03 pm ---I'd suggest to change Char type to WideChar.

--- End quote ---
Please no.  It's really nice that char is char, not something else.  This may not be important when writing normal applications but, when inspecting strings that are outside one's program, it is crucial that a char be a char and not anything else.

ETA:

I just realized that you are suggesting the change to be local to TEdit.PasswordChar, I don't have anything against that. :)

AlexTP:
Why is it critical, that this is Char? What will your application loose?

440bx:

--- 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.

Zoran:
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.

Navigation

[0] Message Index

[#] Next page

Go to full version