* mixi.el (mixi-curl-retrieve): Make the temp buffer multibyte.
authorueno <ueno>
Mon, 23 Oct 2006 08:47:14 +0000 (08:47 +0000)
committerueno <ueno>
Mon, 23 Oct 2006 08:47:14 +0000 (08:47 +0000)
ChangeLog
mixi.el

index 3b0694c..599585d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-10-23  Daiki Ueno  <ueno@unixuser.org>
 
+       * mixi.el (mixi-curl-retrieve): Make the temp buffer multibyte.
+
+2006-10-23  Daiki Ueno  <ueno@unixuser.org>
+
        * mixi.el (mixi-curl-retrieve): New function.
        (mixi-retrieve-function): Don't use NOERROR arg of require.
 
diff --git a/mixi.el b/mixi.el
index 3303209..6b2b333 100644 (file)
--- a/mixi.el
+++ b/mixi.el
@@ -256,7 +256,11 @@ Increase this value when unexpected error frequently occurs."
 (defun mixi-curl-retrieve (url &optional post-data)
   "Retrieve the URL and return gotten strings."
   (with-temp-buffer
+    (if (fboundp 'set-buffer-multibyte)
+       (set-buffer-multibyte nil))
     (let ((orig-mode (default-file-modes))
+         (coding-system-for-read 'binary)
+         (coding-system-for-write 'binary)
          process ret)
       (unwind-protect
          (progn
@@ -282,8 +286,7 @@ Increase this value when unexpected error frequently occurs."
       (unless (looking-at "HTTP/[0-9]+\\.[0-9]+ 200")
        (error (mixi-message "Cannot retrieve")))
       (delete-region (point) (re-search-forward "\r?\n\r?\n"))
-      (setq ret (decode-coding-string (buffer-substring (point) (point-max))
-                                     mixi-coding-system))
+      (setq ret (decode-coding-string (buffer-string) mixi-coding-system))
       (mixi-retrieve-1 ret url post-data))))
 
 (defconst mixi-my-id-regexp