drakma
drakma copied to clipboard
Make UTF-8 the default encoding
It seems to me that nowadays UTF-8 is a far more sensible default encoding than Latin-1 (or anything else, for that matter…)
Is that what's declared by the HTTP spec?
I.e. changing the value of *drakma-default-external-format*
is one thing, but the +latin-1+ constant in the requests may be there for a reason.
Good point. UTF-8 is not permitted in the header, and if there is a change in the default for the body, it must be made sure that headers are unaffected.
I'm wondering now: What problem does this change solve anyway?
To be clear, this patch was a quickfix for me because, as it is, Drakma is incapable of doing HTTP requests with URL characters outside the Latin1 range (in my case, hebrew characters in the URL).
As UTF-8 seems a more sensible hardcoded default nowadays, it seemed to me that my quickfix may be worth integrating. Maybe a better approach would be to fix Drakma so that it actually uses drakma-default-external-format or one of the two &key arguments of HTTP-REQUEST when dealing with the URL (currently it doesn't).
Another option would be using queries instead of puri, since it handles non latin1 characters better.
On 15:25, Wed, Jun 24, 2015 Nowhere Man [email protected] wrote:
To be clear, this patch was a quickfix for me because, as it is, Drakma is incapable of doing HTTP requests with URL characters outside the Latin1 range (in my case, hebrew characters in the URL).
As UTF-8 seems a more sensible hardcoded default nowadays, it seemed to me that my quickfix may be worth integrating. Maybe a better approach would be to fix Drakma so that it actually uses drakma-default-external-format or one of the two &key arguments of HTTP-REQUEST when dealing with the URL (currently it doesn't).
— Reply to this email directly or view it on GitHub https://github.com/edicl/drakma/pull/60#issuecomment-115016927.
Replacing puri with something better has been on my wish list for quite some time. Any patches in that regard will be more than welcome. I don't fear version incompatibility too much.
Oops I meant quri not queries
On Thu, Jun 25, 2015, 01:35 Hans Hübner [email protected] wrote:
Replacing puri with something better has been on my wish list for quite some time. Any patches in that regard will be more than welcome. I don't fear version incompatibility too much.
— Reply to this email directly or view it on GitHub https://github.com/edicl/drakma/pull/60#issuecomment-115147762.
I have a branch that uses quri instead of puri here: https://github.com/tmccombs/drakma/tree/use-quri
unfortunately, it depends on a pull request to quri: https://github.com/fukamachi/quri/pull/15 since quri does not currently have a merge-uris function (which the pull request adds).
Looks good. You seem to have erroneously replaced an "or" by a comma in the HTTP-REQUEST docstring. Once the PR with quri is through, please open a PR with your changes so that we can get rid of PURI. Thanks!
2015-07-06 4:59 GMT+02:00 Thayne McCombs [email protected]:
I have a branch that uses quri instead of puri here: https://github.com/tmccombs/drakma/tree/use-quri
unfortunately, it depends on a pull request to quri: fukamachi/quri#15 https://github.com/fukamachi/quri/pull/15 since quri does not currently have a merge-uris function (which the pull request adds).
— Reply to this email directly or view it on GitHub https://github.com/edicl/drakma/pull/60#issuecomment-118699680.
Please let me know if the problem is solved by the move to QURI in DRAKMA-2.0.0