aboutsummaryrefslogtreecommitdiff
path: root/sx-encoding.el
diff options
context:
space:
mode:
Diffstat (limited to 'sx-encoding.el')
-rw-r--r--sx-encoding.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/sx-encoding.el b/sx-encoding.el
index cf7d0f8..dad8a53 100644
--- a/sx-encoding.el
+++ b/sx-encoding.el
@@ -28,6 +28,9 @@
(require 'cl-lib)
+
+;;;; HTML Encoding
+
(defcustom sx-encoding-html-entities-plist
'(Aacute "Á" aacute "á" Acirc "Â" acirc "â" acute "´" AElig "Æ" aelig "æ"
Agrave "À" agrave "à" alefsym "ℵ" Alpha "Α" alpha "α" amp "&" and "∧"
@@ -91,6 +94,9 @@ Return the decoded string."
(substring ss 1))))))))
(replace-regexp-in-string "&[^; ]*;" get-function string)))
+
+;;;; Convenience Functions
+
(defun sx-encoding-normalize-line-endings (string)
"Normalize the line endings for STRING.
The API returns strings that use Windows-style line endings.
@@ -136,6 +142,9 @@ some cases."
(cl-map #'vector #'sx-encoding-clean-content-deep data))
(t data))))
+
+;;;; GZIP
+
(defun sx-encoding-gzipped-p (data)
"Check for magic bytes in DATA.
Check if the first two bytes of a string in DATA match the magic