Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Marco van de Voort
In our previous episode, Hans-Peter Diettrich said: concatenated without data loss and that the result is then converted to the target string's encoding (except in case the target is RawByteString). How that is implemented exactly is undefined; again in the meaning of undefined, not in the

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Frederic Da Vitoria
2014-11-26 16:54 GMT+01:00 Hans-Peter Diettrich drdiettri...@aol.com: 2) Formatted numbers, as enterd by the user (maybe by copypaste from other applications), can have various encodings. Before a conversion into binary values I'd remove all unexpected characters, except for the last

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Michael Schnell
On 11/26/2014 05:25 PM, Sven Barth wrote: So seemingly you could do MyStringType = type AnsiString(CP_UTF16), and seemingly the size information is set according to this. No, you can't, because the RTL does not handle that. For AnsiString the element size is *always* 1. It's

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Michael Schnell
On 11/26/2014 05:37 PM, Jonas Maebe wrote: invalid (in the meaning of undefined) in both FPC and Delphi. Sorry (I am not a native speaker). But to me undefined and invalid have completely different meanings (in this context). An Invalid use of the language would result in an error (compiler

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Michael Schnell
On 11/26/2014 09:30 PM, Hans-Peter Diettrich wrote: So seemingly you could do MyStringType = type AnsiString(CP_UTF16), and seemingly the size information is set according to this. Not in Delphi XE. Thanks for the clarification. I did have some hope that fpc would be (or could be

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Michael Schnell
On 11/26/2014 07:13 PM, Hans-Peter Diettrich wrote: Not all codepages have a fixed number of bytes per character. The string preamble contains the *element size* (1 for AnsiString), just like with every dynamic array. Sorry for sloppy wording. Of course I did mean element size (Character here

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Jonas Maebe
On 26/11/14 23:41, Hans-Peter Diettrich wrote: In this case the implementation is compiler specific, somewhat different from undefined (in a RawByteString): CP_NONE: this value indicates that no code page information has been associated with the string data. The result of any explicit or

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicodesupport

2014-11-27 Thread Jonas Maebe
On 26/11/14 21:25, Hans-Peter Diettrich wrote: Jonas Maebe schrieb: On 26/11/14 17:41, Tomas Hajny wrote: BTW, in this context - can users choose UTF16BE on little endian platforms (and vice versa)? No, because we do not have any routines that allow a user to set/change the codepage of a

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Mattias Gaertner
On Thu, 27 Nov 2014 11:02:06 +0100 Sven Barth pascaldra...@googlemail.com wrote: [...] Yes, there's a message for that and yes on non-Windows OSes this might be problematic... AFAIK on Unix systems you can start each program with a different locale. The system wide locale is just the default

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Mark Morgan Lloyd
Mattias Gaertner wrote: On Thu, 27 Nov 2014 11:02:06 +0100 Sven Barth pascaldra...@googlemail.com wrote: [...] Yes, there's a message for that and yes on non-Windows OSes this might be problematic... AFAIK on Unix systems you can start each program with a different locale. The system wide

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Mattias Gaertner
On Tue, 25 Nov 2014 20:12:31 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: In our previous episode, Michael Van Canneyt said: The ThousandSeparator is char and supports only 1 byte characters. For example French and Russian need more. Are there any plans to extend it?

Re: [fpc-devel] Regionalisation (Was ThousandSeparator)

2014-11-27 Thread Ralf Quint
On 11/27/2014 9:09 AM, peter green wrote: Hans-Peter Diettrich wrote: But back to the original problem: I managed to create another user, whose number format settings match the expections of the Ez-Builder, while using my German keyboard. For Linux users this may sound like an easy job, but

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Hans-Peter Diettrich
Sven Barth schrieb: At my old company our Delphi application handled runtime changes to these settings rather well. For display the normal XToY (e.g. DateToStr) functions are used which use the DefaultFormatSettings which are updated automatically (the VCL's message loop triggers a repaint

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Hans-Peter Diettrich
Michael Schnell schrieb: I now understand that the Element Size field in the String header is quite dummy, as under the hood there are two completely separate concepts for one-byte-Strings and 2-Byte Strings and none for other Element sizes. After a code review I realized that the element

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Hans-Peter Diettrich
Frederic Da Vitoria schrieb: 2014-11-26 16:54 GMT+01:00 Hans-Peter Diettrich drdiettri...@aol.com mailto:drdiettri...@aol.com: 2) Formatted numbers, as enterd by the user (maybe by copypaste from other applications), can have various encodings. Before a conversion into binary

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Hans-Peter Diettrich
Michael Schnell schrieb: On 11/26/2014 07:13 PM, Hans-Peter Diettrich wrote: Not all codepages have a fixed number of bytes per character. The string preamble contains the *element size* (1 for AnsiString), just like with every dynamic array. Sorry for sloppy wording. Of course I did mean

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: On 26/11/14 23:41, Hans-Peter Diettrich wrote: In this case the implementation is compiler specific, somewhat different from undefined (in a RawByteString): CP_NONE: this value indicates that no code page information has been associated with the string data. The result of

Re: [fpc-devel] Regionalisation (Was ThousandSeparator)

2014-11-27 Thread Hans-Peter Diettrich
Michael Thompson schrieb: I hear you, but this issue is so much wider than separators. I know one software package that will only successfully export data to excel if the system regional is one of the English (xxx) variations (Australian guaranteed to work, not really played with the

Re: [fpc-devel] Trying to understand the wiki-Page FPC Unicode support

2014-11-27 Thread Hans-Peter Diettrich
Michael Schnell schrieb: On 11/26/2014 06:37 PM, Hans-Peter Diettrich wrote: An AnsiString consists of AnsiChar's. The *meaning* of these char's (bytes) depends on their encoding, regardless of whether the used encoding is or is not stored with the string. I understand that the

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Sven Barth
Am 28.11.2014 05:01 schrieb Hans-Peter Diettrich drdiettri...@aol.com: Sven Barth schrieb: At my old company our Delphi application handled runtime changes to these settings rather well. For display the normal XToY (e.g. DateToStr) functions are used which use the DefaultFormatSettings which