Last active
January 2, 2016 09:09
-
-
Save kuanyui/8280786 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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