'From Squeak3.1alpha of 28 February 2001 [latest update: #3854] on 16 March 2001 at 1:08:42 pm'! "Change Set: httpEncodeFix-mir Date: 16 March 2001 Author: Michael Rueger Fixed so it deals with already escaed urls."! !HTTPRequest methodsFor: 'private' stamp: 'mir 3/16/2001 13:07'! httpEncodeSafely: aUrl "Encode the url but skip $/ and $:." | encodedStream unescaped | unescaped _ aUrl unescapePercents. encodedStream _ WriteStream on: (String new). unescaped do: [ :c | (c isSafeForHTTP or: [c == $/ or: [c == $:]]) ifTrue: [ encodedStream nextPut: c ] ifFalse: [ encodedStream nextPut: $%. encodedStream nextPut: (c asciiValue // 16) asHexDigit. encodedStream nextPut: (c asciiValue \\ 16) asHexDigit. ] ]. ^encodedStream contents. ! !