Basic usage
ZnClient new get: 'http://zn.stfx.eu/zn/small.html'
> On 7 Dec 2017, at 15:49, Sean P. DeNigris <sean@clipperadams.com> wrote:
>
> 'https://en.wiktionary.org/wiki/prêt#French' asUrl ==>
> ZnCharacterEncodingError: ASCII character expected. Ideas?
Non-ASCII characters are not allowed in a URL (in its external string representation, the input of the parser), they must be encoded.
When you construct a URL from parts, the encoding will be done for you, as you specify unencoded elements.
'https://en.wiktionary.org/wiki' asUrl addPathSegment: 'prêt'; fragment: #French; yourself.
=> https://en.wiktionary.org/wiki/pr%C3%AAt#French
'https://en.wiktionary.org/wiki/pr%C3%AAt#French' asUrl.
And you would be correct to remark that web browsers do allow this, which is more a UI thing.
See also
WebClient/ZnClient wrapper