
Hi, The type of both host and path fields of http-enumerator's Request type is ByteString/Ascii. Does this mean using unicode URLs vai encodeUtf8 is a no go? J

On Tue, Jun 14, 2011 at 6:23 AM, Jeremy Hughes
Hi,
The type of both host and path fields of http-enumerator's Request type is ByteString/Ascii. Does this mean using unicode URLs vai encodeUtf8 is a no go?
J
All it means is you have to handle the encoding yourself. I'm not familiar with the rules for Unicode domain names, but encodeUtf8 should be sufficient for paths. Michael

Jeremy, For proper URI encoding and decoding you can use our uri-encode[1] package. It builds on top of Network.URI. Unfortunately only available via github now, soon also available on hackage. Cheers, Sebastiaan [1] https://github.com/silkapp/uri-encode/blob/master/src/Network/URI/Encode.hs On Jun 14, 2011, at 5:23 AM, Jeremy Hughes wrote:
Hi,
The type of both host and path fields of http-enumerator's Request type is ByteString/Ascii. Does this mean using unicode URLs vai encodeUtf8 is a no go?
J

Hi Sebastiaan,
That code doesn't seem to take into account the differences between
query string and path info for which characters are escaped.
Michael
On Tue, Jun 14, 2011 at 7:01 PM, Sebastiaan Visser
Jeremy,
For proper URI encoding and decoding you can use our uri-encode[1] package. It builds on top of Network.URI.
Unfortunately only available via github now, soon also available on hackage.
Cheers, Sebastiaan
[1] https://github.com/silkapp/uri-encode/blob/master/src/Network/URI/Encode.hs
On Jun 14, 2011, at 5:23 AM, Jeremy Hughes wrote:
Hi,
The type of both host and path fields of http-enumerator's Request type is ByteString/Ascii. Does this mean using unicode URLs vai encodeUtf8 is a no go?
J
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

Oh, forgot to mention, you're right. These functions should only be used on individual path segments and the individual query string, not on the URI in its entire! Note that there is no real specification describing how to use unicode paths and query strings. Luckily most browser act the same, but, as far as I can remember, clients are free to come up with different encodings. Thanks, Sebastiaan On Jun 14, 2011, at 6:04 PM, Michael Snoyman wrote:
Hi Sebastiaan,
That code doesn't seem to take into account the differences between query string and path info for which characters are escaped.
Michael
On Tue, Jun 14, 2011 at 7:01 PM, Sebastiaan Visser
wrote: Jeremy,
For proper URI encoding and decoding you can use our uri-encode[1] package. It builds on top of Network.URI.
Unfortunately only available via github now, soon also available on hackage.
Cheers, Sebastiaan
[1] https://github.com/silkapp/uri-encode/blob/master/src/Network/URI/Encode.hs
On Jun 14, 2011, at 5:23 AM, Jeremy Hughes wrote:
Hi,
The type of both host and path fields of http-enumerator's Request type is ByteString/Ascii. Does this mean using unicode URLs vai encodeUtf8 is a no go?
J

Hi Sebastiaan,
On Wed, Jun 15, 2011 at 4:01 AM, Sebastiaan Visser
Jeremy,
For proper URI encoding and decoding you can use our uri-encode[1] package. It builds on top of Network.URI.
Unfortunately only available via github now, soon also available on hackage.
Sounds useful. I'll check it out. j
participants (3)
-
Jeremy Hughes
-
Michael Snoyman
-
Sebastiaan Visser