Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Sven Barth
Am 28.11.2014 05:01 schrieb "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 a

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 implementation

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

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

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 "ele

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 >: 2) Formatted numbers, as enterd by the user (maybe by copy&paste from other applications), can have various encodings. Before a conversion into binary values I'd remove all un

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

2014-11-27 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: On 26/11/14 21:25, Hans-Peter Diettrich wrote: What about file I/O? It should be possible to read (and write) files of either endianness. Standard I/O only supports single byte code pages (which should be documented). Please clarify "single byte code pages". SBCS are

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

2014-11-27 Thread Hans-Peter Diettrich
Sven Barth schrieb: Just a little remark: please don't throw in WideString, which is a completely different type and only there for easy compatibility with COM and other Windows APIs. I mentioned it for completness, and because (at least in Delphi) the elements of an UnicodeString are WideCh

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 whe

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

[fpc-devel] Regionalisation (Was ThousandSeparator)

2014-11-27 Thread peter green
Hans-Peter Diettrich wrote: 2) Formatted numbers, as enterd by the user (maybe by copy&paste from other applications), can have various encodings. Before a conversion into binary values I'd remove all unexpected characters, except for the last (rightmost) '.' or ',', which then becomes the deci

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 i

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

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

2014-11-27 Thread Michael Schnell
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 implementation (in Delphi) seems to be d

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Mattias Gaertner
On Thu, 27 Nov 2014 11:02:06 +0100 Sven Barth 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 on start. Therefore changi

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 co

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

Re: [fpc-devel] ThousandSeparator

2014-11-27 Thread Sven Barth
Am 27.11.2014 08:47 schrieb "Mark Morgan Lloyd" < markmll.fpc-de...@telemetry.co.uk>: > > Sven Barth wrote: >> >> On 26.11.2014 16:54, Hans-Peter Diettrich wrote: >>> >>> When the system does not notify all other (running) programs of such an >>> global change, or when some other stupid program doe

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" h

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

2014-11-27 Thread Michael Schnell
On 11/26/2014 07:54 PM, Hans-Peter Diettrich wrote: Delphi XE does not properly support UTF-8. That is what I supposed. Of course the developers at Embarcadero did not need to think about portability to other OSes than Windows when crafting the concept. But obviously fpc needs proper support

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 extend

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 (com

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 hard

Re: [fpc-devel] ThousandSeparator

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

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", n