Tinderbox v10 Icon

urlEncode(dataStr)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Data Type Returned: 

Operator First Added: 

Operator in Current Baseline: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Formatting  [other Formatting operators]

 String [about String data type]

 v4.0.0

 Baseline

 As at baseline


urlEncode(dataStr)

urlEncode() converts a dataStr string to 'urlEncoded' form for the web, in accordance with RFC1738. URLs should not contain spaces, control characters, or non-ASCII characters. Characters that are illegal in URLs are encoded as '%' followed by the corresponding hexadecimal character code, e.g. space = %20.

Thus:

$MyString = urlEncode("Hello world"); 

sets $MyString to 'Hello%20world'.

dataStr should be a quoted literal string or a reference to a string value.

The characters ? and / are percent-encoded by urlEncode(), e.g. as %3F and %2F. Even though these are now permitted in the query portion of URLs, the Apple NSURL used by Tinderbox balks at their presence.


See also—notes linking to here: