>>>>> function TMyUnicodeIniFile.ReadString(const Section, Ident, >>>>> Default: string): string; >>>>> begin >>>>> result:=utf8decode(inherited ReadString(section, ident, default)); >>>>> end; >>>>> >>>>> procedure TMyUnicodeIniFile.WriteString(const Section, Ident, >>>>> Value: string); >>>>> begin >>>>> inherited WriteString(Section, Ident, Utf8Encode(Value)); >>>>> end; >>>> >>>> >>>> That's the kind of code I had in mind. >>> >>> It is not that easy! >>> The code above might work if String maps to an AnsiString, >>> however fails if String maps to a UnicodeString ( Delpi 2009 ). >> >> What would be the issue ? >> Would quoted printable version be a better solution ? > > That would work of course just like base 64 etc, but I suggust to use > a encoding that common text editors understand.
That's basically a good idea :-) What about having a kind of quoted-printable (or any other encoding scheme) which would only encode characters which cannot be represented in the current ansi code page ? This would have the advantage that most european countries wouldn't see anything special unless they use very uncommon unicode characters. Of course the ini file itself would not be transportable to another codepage but this is not a problem since it is for storing local data and not send data accross the world. The disadvantage would be that text editor would not decode those unicode characters. Only asian countries and a few one using no latin characters would be less happy since most characters would be encoded. Anyway, it would work. After all, even if it is handy to use a text editor, the ini files in the demos are not intended to be edited. They are just storage for value grabbed from the user interface. -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- 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