HTTP icon indicating copy to clipboard operation
HTTP copied to clipboard

urlDecode is partial

Open erikd opened this issue 10 years ago • 3 comments

In ghci:

ghci > urlDecode "http://twitter.com/fred/statuses/200"
"http://twitter.com/fred/statuses/200"
ghci > urlDecode "http://twitter.com/%user_screen_name%/statuses/%id%"
"http://twitter.com/*** Exception: Char.digitToInt: not a digit 'u'

It would be vastly nicer if urlDecode's type was something like String -> Either String String.

erikd avatar Feb 19 '15 07:02 erikd

+1 - even the definition for unEscapeString seems saner.

mwotton avatar Feb 19 '15 10:02 mwotton

I wonder if this function even belongs in HTTP - would network-uri be a better home?

hsenag avatar Feb 26 '15 07:02 hsenag

network-uri already has unEscapeString which has better behaviour. maybe it should just be thrown out.

mwotton avatar Feb 26 '15 07:02 mwotton