Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-09 Thread Bjørnar Nielsen
Arno, ... try the following code and let me know how it works for you, The code works for me. But should not the first overload directive be inside the conditional define? Regards Bjørnar -- To unsubscribe or change your settings for TWSocket mailing list please goto

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-09 Thread Arno Garrels
Bjørnar Nielsen wrote: Arno, ... try the following code and let me know how it works for you, The code works for me. But should not the first overload directive be inside the conditional define? Yes, it's better inside, corrected. Just updated the svn repository. -- Arno Garrels --

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-06 Thread Bjørnar Nielsen
Arno, Would you expect a correct result as well if you base64-decoded a quoted-printable encoded string? No, I agree. But the problem is not the decoding itself but the way Unicode-chars and Ansi-chars are treated. This is the line where the problem lies: MyAnsichar :=

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-06 Thread Arno Garrels
Bjørnar Nielsen wrote: Arno, Would you expect a correct result as well if you base64-decoded a quoted-printable encoded string? No, I agree. But the problem is not the decoding itself but the way Unicode-chars and Ansi-chars are treated. This is the line where the problem lies:

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-06 Thread Bjørnar Nielsen
Arno, The only workaround that comes to my mind was another overload that takes a RawByteString instead of string. I won't use AnsiString because implicit ansi string casts must be avoided too. That would work for me. I'm not very familiar with the use of RawByteString, but I made

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-06 Thread Arno Garrels
Bjørnar, Arno, The only workaround that comes to my mind was another overload that takes a RawByteString instead of string. I won't use AnsiString because implicit ansi string casts must be avoided too. That would work for me. I'm not very familiar with the use of RawByteString, but

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread Bjørnar Nielsen
A little change inside the function also must be made to make it work: The line with htoi2 need a little change, the complete code is this: function UrlDecode(const S : AnsiString; SrcCodePage: Cardinal = CP_ACP; DetectUtf8: Boolean = TRUE) : String; var I, J, L : Integer; U8Str :

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread andy
Dear bjor...@sentinel.no, I will be away on holiday from 27/7/2010 until 10/8/2010 and will be unable to deal with your recent message regarding `Re: [twsocket] Found a bug and made a fix in function UrlDecode`. For technical support enquiries please email supp...@ietgroup.com or telephone

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread Arno Garrels
Bjørnar, When calling the function like this: Memo2-Text = UrlDecode(Ã...ge,CP_ACP,false); // Ã...ge is UTF8encoding of Åge Ã...ge is not a valid URL encoded string. Åge URL encoded was: %C3%85ge //UTF-8 %C5ge //Windows-1252 Try this: {code} var Str: string; begin Str :=

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread andy
Dear arno.garr...@gmx.de, I will be away on holiday from 27/7/2010 until 10/8/2010 and will be unable to deal with your recent message regarding `Re: [twsocket] Found a bug and made a fix in function UrlDecode`. For technical support enquiries please email supp...@ietgroup.com or telephone

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread Bjørnar Nielsen
Ã...ge is not a valid URL encoded string. I know, but it is valid UTF8. I think trying to url-decode it should not break the string. I have a webserver that works against different clients, and not all of the clients url-encode data in the url. But all of the clients UTF8-encode data. That

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread andy
Dear bjor...@sentinel.no, I will be away on holiday from 27/7/2010 until 10/8/2010 and will be unable to deal with your recent message regarding `Re: [twsocket] Found a bug and made a fix in function UrlDecode`. For technical support enquiries please email supp...@ietgroup.com or telephone

Re: [twsocket] Found a bug and made a fix in function UrlDecode

2010-08-05 Thread Arno Garrels
Bjørnar, Ã...ge is not a valid URL encoded string. I know, but it is valid UTF8. I think trying to url-decode it should not break the string. I do not think so. Would you expect a correct result as well if you base64-decoded a quoted-printable encoded string? An URL containing anything