[fpc-pascal] Patch: new XML export for FCL-DB, was: SDFDataset multiline support: request for a look at patch+test, issue 17285

Reinier Olislagers reinierolislagers at gmail.com
Sat Jul 23 14:52:47 CEST 2011


On 23-7-2011 14:40, Ludo Brands wrote:
>>> DecimalSeparator is set to the system value in Sysutils and 
>> correspond 
>>> to the machines localisation. You shouldn't hardcode it.
>> Well, I want to have the same output regardless of which 
>> locale you're in. (Unless there's a really good reason not to 
>> do that, or maybe, if there is a way to specify locale in the 
>> output XML) So then I should hardcode it, right? (I'm 
>> resetting them to their previous settings at the end of the 
>> module, but there might be a better way of doing that).
>>
> Isn't property FormatSettings: TXMLXSDFormatSettings supposed to be used for
> this? It has a Property DecimalSeparator. 
> 
> Ludo
I think we may misunderstand one another.

What I propose:
1. do NOT localize decimal separator in XML output, but keep US format .
This has the advantage that export of the same data on any system will
lead to the same results. (Disadvantage: Access might barf if a decimal
, is suddenly a decimal .)

There are 2 more options:
2. Localize decimal separator according to OS locale settings such as
Access XP is doing.
3. Follow the FormatSettings setting given in the GUI to determine
output type.
(Or a combination of these)

In cases 1 and 3, I might need to customize the decimal separator for
float export. This means (as far as I have been able to find out)
tweaking the Sysutils.Formatsettings... Right?

In any event, I'll first try and see what newer versions of Access and
ADO.NET do...

Reinier



More information about the fpc-pascal mailing list