+2013-06-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * eww.el (eww-detect-charset): Improve regexp; move backward.
+
2013-06-18 Glenn Morris <rgm@gnu.org>
* mm-decode.el (widget-convert-button): Autoload.
(setq url (concat "http://" url)))
(url-retrieve url 'eww-render (list url)))
-(defun eww-detect-charset (html-p)
- (let ((case-fold-search t)
- (pt (point)))
- (or (and html-p
- (re-search-forward
- "<meta[\t\n\r ]+[^>]*charset=\\([^\t\n\r \"/>]+\\)" nil t)
- (goto-char pt)
- (match-string 1))
- (and (looking-at
- "[\t\n\r ]*<\\?xml[\t\n\r ]+[^>]*encoding=\"\\([^\"]+\\)")
- (match-string 1)))))
-
(defun eww-render (status url &optional point)
(let ((redirect (plist-get status :redirect)))
(when redirect
(forward-line 1))
headers))
+(defun eww-detect-charset (html-p)
+ (let ((case-fold-search t)
+ (pt (point)))
+ (or (and html-p
+ (re-search-forward
+ "<meta[\t\n\r ]+[^>]*charset=\"?\\([^\t\n\r \"/>]+\\)" nil t)
+ (goto-char pt)
+ (match-string 1))
+ (and (looking-at
+ "[\t\n\r ]*<\\?xml[\t\n\r ]+[^>]*encoding=\"\\([^\"]+\\)")
+ (match-string 1)))))
+
(defun eww-display-html (charset url)
(unless (eq charset 'utf8)
(decode-coding-region (point) (point-max) charset))