ioan 45 Posted March 21, 2022 I'm using TNetEncoding.URL.Encode to encode the following string: E+C1NU0Z0ikcOdZF158VAypoEl4nc9bTokltVV+PkfPeO3/6pmZTRo3h17SC+x6SdK4qIrNnWv3rd9RGnQ== The result is: E%2BC1NU0Z0ikcOdZF158VAypoEl4nc9bTokltVV%2BPkfPeO3%2F6pmZTRo3h17SC%2Bx6SdK4qIrNnWv3rd9RGnQ%3D%3D Trying to use TNetEncoding.URL.Decode doesn't get me back to the original string, what am I doing wrong? Share this post Link to post
qubits 20 Posted March 21, 2022 not sure.. procedure TMainFrm.Button1Click(Sender: TObject); var aStr,eStr,origStr:String; begin origStr:='E+C1NU0Z0ikcOdZF158VAypoEl4nc9bTokltVV+PkfPeO3/6pmZTRo3h17SC+x6SdK4qIrNnWv3rd9RGnQ=='; memDisplay.Lines.Insert(0,'Orig:'+origStr); eStr:=tNetEncoding.URL.Encode(origStr); memDisplay.Lines.Insert(0,'Encoded:'+eStr); aStr:=tNetEncoding.URL.Decode(eStr); memDisplay.Lines.Insert(0,'Decoded:'+aStr); if aStr=origStr then memDisplay.Lines.Insert(0,'Equal') else memDisplay.Lines.Insert(0,'Differ'); end; this seems to be equal.. Share this post Link to post
ioan 45 Posted March 21, 2022 Yeah, I tried a simple application just to test and it does work, but in my service doesn't. 7 minutes ago, qubits said: not sure.. this seems to be equal.. Yes, I tried in a simple application and it does work. The problem is that in my service (IntraWeb service) doesn't: Share this post Link to post
qubits 20 Posted March 21, 2022 (edited) looking at the pic, looks like LUserID was encoded not decoded, strange.. maybe try saving id into LUserID and Decode LUserID. Edited March 21, 2022 by qubits Share this post Link to post
Attila Kovacs 629 Posted March 21, 2022 (edited) it's double encoded "=" = "%3D" "%3D" = "%253D" Edited March 21, 2022 by Attila Kovacs 2 Share this post Link to post
qubits 20 Posted March 21, 2022 (edited) lol, small little squiggles, only looked at LUserID, sorry.. 🙂 yeah, input is wrong, should match the encoded, no?? just one more decode and you got it.. or maybe hunt down extra encode.. Edited March 21, 2022 by qubits 1 Share this post Link to post
ioan 45 Posted March 21, 2022 10 minutes ago, Attila Kovacs said: it's double encoded "=" = "%3D" "%3D" = "%253D" You right! That was it, thank you! I was losing my mind 🙂 Share this post Link to post
Remy Lebeau 1394 Posted March 22, 2022 4 hours ago, ioan said: Yes, I tried in a simple application and it does work. The problem is that in my service (IntraWeb service) doesn't: IntraWeb is built on top of Indy, and Indy has its own URL encoder/decoder (the TIdURI class). Share this post Link to post