Leo, Are you sure you understand what percent encoding is ? Check the class comment of ZnPercentEncoding, it has links to a Wikipedia article. Did you see ZnPercentEncoderTests ? Anyway, I would think this is what you want to do: ZnPercentEncoder new encode: 'Neuquén, Neuquén Province, Argentina'. => 'Neuqu%C3%A9n%2C%20Neuqu%C3%A9n%20Province%2C%20Argentina' ZnPercentEncoder new decode: 'Neuqu%C3%A9n%2C%20Neuqu%C3%A9n%20Province%2C%20Argentina'. => 'Neuquén, Neuquén Province, Argentina' Seems to work fine, no ? What problem do you have with ZnUrl ? Sven BTW: this is a pharo-users question.
On 21 Apr 2015, at 22:51, Leo Paniceres <lpaniceres@gmail.com> wrote:
Hi Iâm experiencing a problem when I try to encode an URL with latin characters with accents or circumflex. The example is:
â âZnPercentEncoder new decode: 'Neuquén, Neuquén Province, Argentina'
The IETF standard provides these definitions:
https://www.ietf.org/rfc/rfc3986.txt
https://tools.ietf.org/html/std63
the implementation ZnPercentEncoder, decode: stringStream to: byteStream could be changed to accept characters below 256. (char charCode < 256 instad of char charCode < 128)?
decode: stringStream to: byteStream
| char |
self decodePlusAsSpace.
[ stringStream atEnd ]
whileFalse: [
((char := stringStream next) == $+ and: [ decodePlusAsSpace ])
ifTrue: [ byteStream nextPut: 32 ]
ifFalse: [
char == $%
ifTrue: [ byteStream nextPut: (self readHexFrom: stringStream) ]
ifFalse: [
char charCode < 128
ifTrue: [ byteStream nextPut: char charCode ]
ifFalse: [ self errorAsciiCharacterExpected ] ] ] ]