lambdaisland / uri

A pure Clojure/ClojureScript URI library
Mozilla Public License 2.0
243 stars 21 forks source link

Fix normalize-query for utf-16 #23

Closed FiV0 closed 2 years ago

FiV0 commented 2 years ago

Hi @Gaiwan,

Something like

(require '[lambdaisland.uri :as uri])
(require '[lambdaisland.uri.normalize :as n])

(n/normalize (uri/uri "https://twitter.com/intent/tweet?text=You are welcome 🙂&url=https://lambdaisland.com"))

will currently fail as normalize-query currently does not take utf-16 chars into account.

The patch only fixes the normalize-query part, something like

(n/char-seq (subs "🙂" 0 1))

will still fail. I wasn't quite sure how you want to deal with edge cases like these.

I ran bin/kaocha once.

plexus commented 2 years ago

Thanks @FiV0 , looks good!

plexus commented 2 years ago

Released in 1.11.86