Hi Petr
I have used #urlEncoded in the past, with success, to deal with German umlauts. The secret is to urlEncode just the part containing the diacritics. If you encode the whole url, the slashes are encoded, and this confuses Zinc, which segments the url before decoding.
So I would expect you to be able to read your file with:
ZnEasy get: 'http://domain.com/’,’�����.html' urlEncoded.
However, this also fails with ‘ASCII character expected’, and I can’t understand why. The debug trace has too many levels for me to understand. Zinc is evidently getting in a mess trying to decode the urlEncoded string, but if we try:
’�����.html' urlEncoded urlDecoded
as a separate operation, it works OK.
I think only Sven can explain this for you.
HTH
Peter Kenny
From: Pharo-users <pharo-users-bounces@lists.pharo.org> On Behalf Of Petr Fischer via Pharo-users
Sent: 10 September 2018 10:07
To: pharo-users@lists.pharo.org
Cc: Petr Fischer <petr.fischer@me.com>
Subject: [Pharo-users] ZnURL and parsing URL with diacritics
Hello,
when I try to parse this URL asUrl, error "ZnCharacterEncodingError: ASCII character expected" occurs:
'http://domain.com/�����.html' asUrl.
this also does not work:
ZnEasy get: 'http://domain.com/�����.html'
How to solve this? In the web browser, URL with diacritics is OK.
I tried also this:
ZnEasy get: 'http://domain.com/�����.html' urlEncoded.
but this cripples the whole URL.
Thanks! Petr Fischer