Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-07

Having an always utf-8 string

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hi,

I would like which would be the theoritical way that Free Pascal could support an always utf-8 encoded string (if it will be supported). With that I mean a string which when set by code is converted from widestring to utf-8 in despite of any environmental conditions, or operating system conditions. So I can open a feature request for it.

Based on past discussion, I assume that the prefered way would be using the UTF8String type, is that correct?

Another option would be having the possibility to manually change the output format of the widestring managed.

I think this gets more important as Lazarus moves to UTF-8.

thanks,

Felipe Monteiro de Carvalho
Daniël Mantione
to Felipe Monteiro de Carvalho

Op Mon, 16 Jul 2007, schreef Felipe Monteiro de Carvalho:

Show quoted text 15 lines
Hi, I would like which would be the theoritical way that Free Pascal could support an always utf-8 encoded string (if it will be supported). With that I mean a string which when set by code is converted from widestring to utf-8 in despite of any environmental conditions, or operating system conditions. So I can open a feature request for it. Based on past discussion, I assume that the prefered way would be using the UTF8String type, is that correct? Another option would be having the possibility to manually change the output format of the widestring managed. I think this gets more important as Lazarus moves to UTF-8.

a) We indeed need some configurability in the widestringmanager. b) Ignoring the environment seems a bad idea to me. c) There exists utf8decode/utfencode, so I do not see the problem for UTF-8?

Daniël

peter green
to Felipe Monteiro de Carvalho: I would like which would be the theoritical way that Free Pascal could support an always…
Felipe Monteiro de Carvalho wrote 8 lines
Hi, I would like which would be the theoritical way that Free Pascal could support an always utf-8 encoded string (if it will be supported). With that I mean a string which when set by code is converted from widestring to utf-8 in despite of any environmental conditions, or operating system conditions. So I can open a feature request for it.

You can do this yourself, just create a record containing an ansistring and then use operator overloading to control how it behaves in assignments to other types.