> But "String" is an UTF-16 string in D2009. > How do you pack an UTF-8 string in an UTF-16 String?
I don't ! UTF16 is able to handle all charset and can be used directly with D2009 and up. Before D2009, the user will have to add code to encode their international characters in UTF8 and the component will have to have code to handle it properly. In the component code, you'll have conditional compilation for handling string properties which have a need for international charset. For example a filename in the FTP component. Assuming FTP protocol want UTF8 string, then when compiled with D2009 and up, the component will convert unicode string (UTF-16) to UTF-8 before sending down to the wire. When compiled with pre-D2009, the component will simply takes the string as an UTF-8 string and send it as is. At the application level, let's assume the application has a TEdit to enter a file name. With D2009 and up, there is nothing to do, just pas the text value (UTF-16 !) to the component. With pre-D2009, the application developer will need to use a unicode enabled TEdit (not provided with Delphi !), convert the text value to UTF-8 and feed the FTP component property with it. Isn't it too simple ? Did I miss something ? -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be ----- Original Message ----- From: "Arno Garrels" <[EMAIL PROTECTED]> To: "ICS support mailing" <twsocket@elists.org> Sent: Saturday, August 23, 2008 9:54 PM Subject: Re: [twsocket] FTP and Utf-8 in ICSv7 > Francois PIETTE wrote: >> I think properties can be of type string in all versions. For >> pre-Delphi 2009, the component can easily pack an UTF8 string into >> the AnsiString. Up to the user to handle it properly as an UTF8 >> string. > > But "String" is an UTF-16 string in D2009. > How do you pack an UTF-8 string in an UTF-16 String? > > -- > Arno Garrels > > >> >> -- >> [EMAIL PROTECTED] >> The author of the freeware multi-tier middleware MidWare >> The author of the freeware Internet Component Suite (ICS) >> http://www.overbyte.be >> >> >> ----- Original Message ----- >> From: "Arno Garrels" <[EMAIL PROTECTED]> >> To: <twsocket@elists.org> >> Sent: Saturday, August 23, 2008 7:57 PM >> Subject: [twsocket] FTP and Utf-8 in ICSv7 >> >> >>> Hi All, >>> >>> What do you think about adding Utf8-support to the FTP components >>> in ICSv7 for compilers D7 - D2007 as well? >>> >>> Currently the components treat path and file names as 8-bit ANSI. >>> This works quite well as long as both client and server use the same >>> charset or only characters from the ASCII 7-bit range. >>> >>> Any ideas are welcome. We realy need a solution that works with >>> Delphi 2009 as well where String maps to an UTF-16 string. >>> >>> My prefered solution is changing those string-properties to >>> WideString by introducing a new type alias "UnicodeString" that maps >>> to WideString in compilers pre-D2009 and to String/UnicodeString in >>> Delphi 2009 and later. I think this feature cannot be implemented >>> w/o breaking existing code. Has anybody experience with WideString? >>> This string type is not reference counted and may introduce a >>> serious performance penalty. >>> >>> -- >>> Arno garrels >>> >>> -- >>> 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 > -- > 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 -- 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