Skip to content

Instantly share code, notes, and snippets.

@kuanyui
Last active January 2, 2016 09:09
Show Gist options
  • Save kuanyui/8280786 to your computer and use it in GitHub Desktop.
Save kuanyui/8280786 to your computer and use it in GitHub Desktop.
(let ((url-request-method "GET")
(url-request-extra-headers '(("Content-Type" . "application/x-www-form-urlencoded")))
output-buffer-name
)
(setq output-buffer-name (url-retrieve-synchronously "http://d.hatena.ne.jp/khiker/20111112/url_retrieve_with_timeout"))
(switch-to-buffer output-buffer-name)
(set-buffer-multibyte t)
(goto-char (point-min)))
;; Try this, a buffer will jumped out and you will find a lot of characters cannot be displayed correctly.
;; I found some ways attempting to solve this:
;;(encode-coding-string STRING 'euc-jp)
;;(decode-coding-string STRING 'euc-jp)
;;(set-buffer-file-coding-system 'euc-jp)
;; But still doesn't works
;; However, if saving this buffer, kill and reopen it, all of the characters can be displayed correctly...
;;(By the way, what kind of the buffer that url-retrieve opened? It seems to be not a normal buffer. In these buffer, undo and a lot of actions are not allowed.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment