# HG changeset patch # User Claus Gittinger # Date 1294575096 -3600 # Node ID cae6bc9366532ea9a09517b5d21a10cd433f0d5f # Parent a7ff39418d38834190258b2c9098605f8b5c3ebb changed: #urlEncode2:on: rfc states that tilde must be escaped diff -r a7ff39418d38 -r cae6bc936653 HTMLUtilities.st --- a/HTMLUtilities.st Sun Jan 09 10:47:13 2011 +0100 +++ b/HTMLUtilities.st Sun Jan 09 13:11:36 2011 +0100 @@ -218,7 +218,7 @@ "helper to escape invalid/dangerous characters in an urls arguments. Similar to urlEncode, but treats '*','~' and spaces differently. (some clients, such as bitTorrent seem to require this - time will tell...) - Any byte not in the set 0-9, a-z, A-Z, '.', '-', '_' and '~', is encoded using + Any byte not in the set 0-9, a-z, A-Z, '.', '-', '_', is encoded using the '%nn' format, where nn is the hexadecimal value of the byte. see: RFC1738" @@ -230,7 +230,7 @@ [rs atEnd] whileFalse: [ c := rs next. - (c isLetterOrDigit or:[ ('-_.~' includes:c) ]) ifTrue:[ + (c isLetterOrDigit or:[ ('-_.' includes:c) ]) ifTrue:[ ws nextPut:c. ] ifFalse:[ ws nextPut: $%. @@ -239,6 +239,7 @@ ]. "Created: / 09-01-2011 / 10:32:27 / cg" + "Modified: / 09-01-2011 / 13:11:17 / cg" ! urlEncode:aStringOrStream on:ws @@ -496,9 +497,9 @@ !HTMLUtilities class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic2/HTMLUtilities.st,v 1.13 2011-01-09 09:47:13 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic2/HTMLUtilities.st,v 1.14 2011-01-09 12:11:36 cg Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libbasic2/HTMLUtilities.st,v 1.13 2011-01-09 09:47:13 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic2/HTMLUtilities.st,v 1.14 2011-01-09 12:11:36 cg Exp $' ! !