drakma icon indicating copy to clipboard operation
drakma copied to clipboard

Make UTF-8 the default encoding

Open kephas opened this issue 9 years ago • 10 comments

It seems to me that nowadays UTF-8 is a far more sensible default encoding than Latin-1 (or anything else, for that matter…)

kephas avatar Jun 19 '15 14:06 kephas

Is that what's declared by the HTTP spec?

stassats avatar Jun 19 '15 14:06 stassats

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.

stassats avatar Jun 19 '15 14:06 stassats

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?

hanshuebner avatar Jun 19 '15 14:06 hanshuebner

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).

kephas avatar Jun 24 '15 21:06 kephas

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.

tmccombs avatar Jun 24 '15 21:06 tmccombs

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.​

hanshuebner avatar Jun 25 '15 07:06 hanshuebner

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.

tmccombs avatar Jun 26 '15 06:06 tmccombs

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).

tmccombs avatar Jul 06 '15 02:07 tmccombs

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.

hanshuebner avatar Jul 06 '15 04:07 hanshuebner

Please let me know if the problem is solved by the move to QURI in DRAKMA-2.0.0

hanshuebner avatar Jul 10 '15 07:07 hanshuebner