gregsexton / httprepl.el

An HTTP REPL for Emacs
130 stars 3 forks source link

Handling of charsets #5

Open pidu opened 10 years ago

pidu commented 10 years ago

Would be nice if charsets would work, otherwise cool mode.

gregsexton commented 10 years ago

Can you give a specific example of what doesn't work? What are you expecting and what doesn't hold up to this expectation? Which charset are you having issues with? Which version of Emacs are you running?

pidu commented 10 years ago

So, I'm running Emacs 24.4, and from the httprepl issue:

get www.google.se

I get headers specifying ISO-8859-1... httprepl 2014-10-31 14-19-09

but the body has some strange stuff in it: httprepl 2014-10-31 14-19-52

Now this particular case was for ISO-8859-1 but I recall seeing this even for charset UTF-8.

I noticed these problems on my first test of the httprepl so I just assumed charset conversions had not been considered. Now that I've investigated further it seems just buggy because it sometimes work.

gregsexton commented 10 years ago

OK, I see the problem now. I'll look in to this and see what I can do. If you find an example url with a utf-8 response that doesn't work, that would be really useful too.

There is no charset/encdoing logic in httprepl, I get the same problem if I run curl www.google.se in eshell or using M-x shell-command.

gregsexton commented 9 years ago

I've been looking in to this. I need to

(defun httprepl-insert (&rest args)
  (dolist (string args)
    (when string
      (comint-output-filter (get-buffer-process (current-buffer)) (decode-coding-string string 'iso-8859-1)))))