Hi,

first off, I found this article a good read on the topic:
http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding
 
<http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding>

> One thing which has not been looked at in this discussion is why Jimmie's 
> first attempt to solve the problem failed. He replaced every comma in the 
> query by its percent encoding, '%2C'. This failed because ZnClient replaced 
> this by '%252C', i.e. it percent encoded the percent sign. In my first 
> attempt to help him, I tried replacing the query line by:
>  queryAt: 'fields' put: 'displayName,instrument,pip' urlEncoded;
> but this produced the same result. The puzzling thing is why ZnClient is 
> doing this. 

This is because the #queryAt:put: method accept non-url-encoded strings.
The application is not responsible for encoding the URL, Zinc is.
How could I otherwise ever send a string with a percent character via a url ?

> In http://www.w3.org/Addressing/URL/uri-spec.html it is stated that:
> " The percent sign ("%", ASCII 25 hex) is used as the escape character in the 
> encoding scheme and is never allowed for anything else."
> Further on, there are two examples of strings which are illegal as URIs 
> because they contain percent signs which are not followed by two decodable 
> hex characters. Hence, if ZnClient encounters a percent sign in a query 
> string, either it is the beginning of a percent encoded character or it is 
> illegal.

This is true when Zn is parsing a URL, not when it’s accepting parts to 
construct the URL (like when you’re using the #queryAt:put: methods).

cheers
Johan

Reply via email to