Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
77f05e24
Commit
77f05e24
authored
Nov 16, 2005
by
Stefan Monnier
Browse files
(url-insert-file-contents): Use the charset info
provided by the HTTP server, if any.
parent
0a37f512
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
lisp/url/ChangeLog
lisp/url/ChangeLog
+8
-3
lisp/url/url-handlers.el
lisp/url/url-handlers.el
+8
-6
No files found.
lisp/url/ChangeLog
View file @
77f05e24
2005-11-16 Juergen Hoetzel <emacs@hoetzel.info> (tiny change)
* url-handlers.el (url-insert-file-contents): Use the charset info
provided by the HTTP server, if any.
2005-10-20 CHENG Gao <chenggao@gmail.com> (tiny change)
* url-nfs.el (top level):
* url-handlers.el (directory-files):
* url-nfs.el (top level):
* url-handlers.el (directory-files):
* url-file.el (top level):
* url-dired.el (url-dired-minor-mode-map):
* url-dired.el (url-dired-minor-mode-map):
* url-http.el (url-http-chunked-encoding-after-change-function):
Remove XEmacs support.
...
...
lisp/url/url-handlers.el
View file @
77f05e24
...
...
@@ -202,6 +202,7 @@ accessible."
(
defun
url-insert-file-contents
(
url
&optional
visit
beg
end
replace
)
(
let
((
buffer
(
url-retrieve-synchronously
url
))
(
handle
nil
)
(
charset
nil
)
(
data
nil
))
(
if
(
not
buffer
)
(
error
"Opening input file: No such file or directory, %s"
url
))
...
...
@@ -215,13 +216,14 @@ accessible."
(
mm-destroy-parts
handle
)
(
if
replace
(
delete-region
(
point-min
)
(
point-max
)))
(
save-excursion
(
setq
charset
(
mail-content-type-get
(
mm-handle-type
handle
)
'charset
))
(
let
((
start
(
point
)))
(
insert
data
)
;; FIXME: for text/plain data, we sometimes receive a `charset'
;; annotation which we could use as a hint of the locale in use
;; at the remote site. Not sure how/if that should be done. --Stef
(
decode-coding-inserted-region
start
(
point
)
url
visit
beg
end
replace
)))
(
if
charset
(
insert
(
mm-decode-string
data
(
mm-charset-to-coding-system
charset
)))
(
progn
(
insert
data
)
(
decode-coding-inserted-region
start
(
point
)
url
visit
beg
end
replace
)))))
(
list
url
(
length
data
))))
(
defun
url-file-name-completion
(
url
directory
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment