Re: [twsocket] Proposal to replace TIniFile byTRegIniFile in allv7 demo applications
>> It appears the OS API code is not reading the 3 UTF8 BOM bytes >> correctly if there are only 3 byte before the section name. >> > > That's what I mean, don't rely on the API in this case since all > this stuff is undocumented. Better use a class that handles > file access natively. > The class can fix the issue checking for the presence of the EOL after the BOM, and add it if needed, but all this are just suggestion, you guys decide ;-) -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Proposal to replace TIniFile byTRegIniFile in allv7 demo applications
RTT wrote: > Arno Garrels wrote: >> Back again, it does not work reliable for me, please try the >> attached INI. >> >> > This elist support attachments?! Or my email client made something > wrong or the elist software trashed the attachment. > Please send it directly to my email address RTT wrote: > Arno Garrels wrote: >> Here's the INI file that does not work with your code for me. >> >> > It appears the OS API code is not reading the 3 UTF8 BOM bytes > correctly if there are only 3 byte before the section name. That's what I mean, don't rely on the API in this case since all this stuff is undocumented. Better use a class that handles file access natively. -- Arno -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Proposal to replace TIniFile byTRegIniFile in allv7 demo applications
Arno Garrels wrote: > Here's the INI file that does not work with your code for me. > > It appears the OS API code is not reading the 3 UTF8 BOM bytes correctly if there are only 3 byte before the section name. Probably a bug in the API, or a text files requirement, BOM always terminated by EOL? An empty line,or comment line, before the section start, fix the issue. For note, when the INI file is created by my class code, the API alway add an empty line after the BOM. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Proposal to replace TIniFile byTRegIniFile in allv7 demo applications
Arno Garrels wrote: > Back again, it does not work reliable for me, please try the attached INI. > > This elist support attachments?! Or my email client made something wrong or the elist software trashed the attachment. Please send it directly to my email address -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Proposal to replace TIniFile byTRegIniFile in allv7 demo applications
Arno Garrels wrote: > Arno Garrels wrote: >>> function TMyUnicodeIniFile.ReadString(const Section, Ident, Default: >>> string): string; >>> begin >>> result := inherited; >>> if fIsUTF8 then >>>result := utf8decode(result) >>> end; >> >> As I wrote in my previous message, this does not work for me. >> Whenever Windows finds an UTF-8 BOM it does not return a single byte. > > My fault, now it works. Back again, it does not work reliable for me, please try the attached INI. > But it won't be the same level of backwards > compatibility that can be achieved with a class derived from > TCustomIniFile. > > -- > Arno-- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be