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
2f4e9c47
Commit
2f4e9c47
authored
May 21, 2002
by
Colin Walters
Browse files
(sgml-xml-auto-coding-function): Update with more known XML encodings.
parent
1b65564c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
lisp/international/mule.el
lisp/international/mule.el
+6
-6
No files found.
lisp/international/mule.el
View file @
2f4e9c47
...
...
@@ -1928,17 +1928,17 @@ This function is intended to be added to `auto-coding-functions'."
(
when
(
re-search-forward
"\\`[[:space:]\n]*<\\?xml"
)
(
let
((
end
(
save-excursion
;; This is a hack.
(
search-forward
"\"\\s-*?>"
size
t
))))
(
re-
search-forward
"\"\\s-*
\\
?>"
size
t
))))
(
when
end
(
if
(
re-search-forward
"encoding=\"\\(.+?\\)\""
end
t
)
(
let
((
match
(
downcase
(
match-string
1
))))
;; FIXME: what other encodings are valid, and how can we
;; translate them to the names of coding systems?
(
cond
((
string=
match
"utf-8"
)
'utf-8
)
(
cond
((
member
match
'
(
"utf-8"
"iso-2022-jp"
"euc-jp"
"shift_jis"
))
(
intern
match
))
((
string-match
"iso-8859-[[:digit:]]+"
match
)
(
intern
match
))
(
t
nil
)))
(
t
(
message
"Warning: unknown XML encoding %s"
match
)
nil
)))
'utf-8
)))))
;;;
...
...
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