Recent

Author Topic: UTF8 SysUtils.  (Read 3057 times)

skiy1337lazarus

  • New Member
  • *
  • Posts: 34
UTF8 SysUtils.
« on: September 20, 2015, 07:02:29 pm »
I was stepping through the TTrayIcon code, and most interestingly, in win32TrayIcon.inc : 178:
My ANSI filename is displayed as UTF8.... which is wrong....

FindFirst returns ANSI... I understand that form resources are saved in UTF8.... but FindFirst returns ANSI.

Are all GUI components UTF8 now? If so, then only FindFirstUTF8 should be allowed/available.

I don't want UTF8! lol

Bart

  • Hero Member
  • *****
  • Posts: 5713
    • Bart en Mariska's Webstek
Re: UTF8 SysUtils.
« Reply #1 on: September 20, 2015, 10:47:32 pm »
The entire LCL is UTF8, so any text that is shown on a GUI is expected to be in UFT8.
This has been the case for many years now.

If the component uses FindFirst/Next it should use SysToUtf8() before showing the text, or better still use FindFirstUtf8 and comapanions.

With 3.0.0rc1 and trunk the conversion is automatically when "Utf8 in RTL" is used.

Bart

skiy1337lazarus

  • New Member
  • *
  • Posts: 34
Re: Utf8 in RTL
« Reply #2 on: September 21, 2015, 08:01:41 am »
Thank you very  much.

Patito

  • New member
  • *
  • Posts: 7
Re: UTF8 SysUtils.
« Reply #3 on: September 21, 2015, 08:49:08 am »
The entire LCL is UTF8, so any text that is shown on a GUI is expected to be in UFT8.
This has been the case for many years now.

If the component uses FindFirst/Next it should use SysToUtf8() before showing the text, or better still use FindFirstUtf8 and comapanions.

With 3.0.0rc1 and trunk the conversion is automatically when "Utf8 in RTL" is used.


But be careful with that. E.g. Conversion of Windows-Filenames to UTF-8 isn't completely lossless.
Windows doesn't use standard UTF-16 everywhere...

https://simonsapin.github.io/wtf-8/

 

TinyPortal © 2005-2018