* * *

Author Topic: TRegistry and UTF8  (Read 607 times)

RolfW

  • New member
  • *
  • Posts: 5
TRegistry and UTF8
« on: July 15, 2017, 04:48:54 pm »
Hi,
can anybody tell me why the TRegistry class still can't handle UTF8 strings?
The windows include file (winreg.inc) isn't that large. Should be possible to change it.
May be my view on the issue is not complete.
Thank you for any hint.
Rolf

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 333
    • Lebeau Software
Re: TRegistry and UTF8
« Reply #1 on: July 25, 2017, 01:13:27 am »
can anybody tell me why the TRegistry class still can't handle UTF8 strings?

Why should it?  The Registry itself does not support UTF-8 strings to begin with, only ANSI and UTF-16 strings.  If you want to store UTF-8 strings, you have to store them as raw binary data.  Otherwise, convert them to UTF-16 before storing, and convert them back to UTF-8 after retrieving.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) open source project - Admin, Developer

Thaddy

  • Hero Member
  • *****
  • Posts: 4516
Re: TRegistry and UTF8
« Reply #2 on: July 25, 2017, 09:35:48 am »
It is fixed in trunk from this week.  Note FPC usually only guarantees to supports ANSI and UTF16 and NOT UTF8, but methods for handling UTF8 correctly are now added in the FCL for TRegistry on other platforms than Windows and the Windows version now uses UTF16 internally. FPC will probably never support UTF8 directly.
« Last Edit: July 25, 2017, 09:47:15 am by Thaddy »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus