Peter Van Hove wrote: >>> Should I URL encode the POST data as well ? >> >> Yes. > > I did ... it did not help. > I used your older URLEncode() function that has UTF-8 conversion hard > coded in it (I could not check out the newer version, see other > email). > > I came to the conclusion that the '=' sign cannot be encoded as then > it becomes part of the value. That's ok, now that I know. > > But when I sent the special character, which was clearly changed to > UTF-8 the receiving end still sees two other weird characters instead. > So the two bytes are assumed to be 2 characters instead of being put > back together to only one character. > I suppose I have to assume that the host is not expecting UTF-8 at > all then ?
That seems correct. In case there is no charset given neither in the form attributes nor in the HTML document or in the HTTP Content-Type header you can only assume that plain ASCII is accepted. Otherwise you must convert your UnicodeString to the charset accepted by the server. In order to get the Windows code page ID of a MIME charset string include unit OverbyteIcsCharsetUtils.pas and call MimeCharsetToCodePage() or MimeCharsetToCodePageDef(). For example: UrlEncode(YourString, MimeCharsetToCodePageDef('iso-8859-1')); -- 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