Replies: 4 comments 24 replies
-
|
This is difficult topic... problem is, that your url is mixing url encoded value with not encoded. Correct way how to get the correct data in above case is: query: "hergé & tintin" ;; notice that it is human readable content
url: join https://duckduckgo.com/?q= enhex/uri query
;== https://duckduckgo.com/?q=herg%25C3%25A9+%2526+tintin
as string! url
;== "https://duckduckgo.com/?q=herg%C3%A9+%26+tintin"
parse read url [thru "<title>" return copy title to "<"]
;== "hergé & tintin at DuckDuckGo" ;<-- expected query result |
Beta Was this translation helpful? Give feedback.
-
|
@rgchris when I modify the code not to provide automatic conversion, then So do you really think, that current version is the wrong one? |
Beta Was this translation helpful? Give feedback.
-
|
@rgchris Another issue, when the URL scanner does not normalize the input: >> c: 1 f2: try [load mold f1: append copy a:/ to char! c]
== a:/%01
>> as string! f1
== "a:/^A"
>> as string! f2
== "a:/%01"
>> f1
== a:/%01 ;<--- because MOLD does not allow to produce an invalid URL
>> f2
== a:/%01
>> f1 = f2
== #(false) ;<--- is this acceptable?As I said... this topic is problematic. |
Beta Was this translation helpful? Give feedback.
-
|
I've pushed changes squashed in this commit: ebe607c |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a longstanding issue in Redbol languages. Take the URL
https://duckduckgo.com/?q=hergé+%26+tintin. In most variants, this URL is transformed by the loader:The imperative here is data integrity (Redbol is, after all, a data-first format). In auto-resolving the percent encoding, the URL changes value and means something different when resolved. Also note that in a browser, while the
émay be converted to percent encoding as part of the request, it is still displayed aséin the location bar. This behaviour may also be incompatible with non-HTTP URL schemes. My contention is that URLs should be dumb strings that round-trip input-to-output and should only be resolved when passed to a scheme—that includes URLs that would appear to be malformed (e.g.meta:thing=100%orhttp://latin1.com/?q=herg%E9); anything else is incorrect.I have an open ticket on Red and have made the case for Ren-C (which now exhibits the correct behaviour). There are related tickets for Rebol 3 (#1644, #2012 and #2207).
Beta Was this translation helpful? Give feedback.
All reactions