Hi Gareth,
On 19 Mar 2018, at 15:23, Gareth Cox <[hidden email]> wrote: When ZnUrl parses a string representation of a URL it is indeed strict. As per the spec this must be ASCII. Browsers typically allow a wider range of input. But of course, these URLs are supported, you just have to construct them differently. If you use the direct construction API, you can use full Unicode. ZnUrl new scheme: #http; host: 'www.yr.no'; addPathSegments: #('place' 'Mexico' 'Nuevo_León' 'Monterrey' 'forecast.xml'); yourself. You'll see that the external representation of your URL is actually the following, which is acceptable to the parser. BTW, I would do your request as follows (using XML Support) : ZnClient new systemPolicy; http; host: 'www.yr.no'; addPath: #('place' 'Mexico' 'Nuevo_León' 'Monterrey' 'forecast.xml'); accept: 'text/xml' asMIMEType; contentReader: [ :entity | XMLDOMParser parse: entity contents ]; get. In my Pharo 7 image, this gives me a nice coloured, fully parsed DOM: HTH, Sven |
Thanks Sven
I will have to first deconstruct the url and then reconstruct it as you mentioned. We discussed this in the discord channel and came to the same conclusion. I really like your final solution and will probably go with that. Thanks Gareth IT Manager/Developer email: [hidden email] cell: +27 (0)78 374 9035 Inspired Org (PTY) Ltd On 19 Mar 2018 16:55, Sven Van
Caekenberghe wrote:
Hi Gareth, |
Free forum by Nabble | Edit this page |