Christophe Weblog Wiki Code Publications Music
a couple of robustification fixes
authorChristophe Rhodes <csr21@cantab.net>
Thu, 16 Oct 2014 13:33:19 +0000 (14:33 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Thu, 16 Oct 2014 13:33:19 +0000 (14:33 +0100)
- let squeeze-string-plistify handle a nil `end' parameter
- decode the url-unhexified string as utf-8

squeeze.el

index cdfb86d946b900ca24736058948df3cbd7e88d4a..1e34449f76861986fee4ab9ca0ca31686188cb59 100644 (file)
   playerindex playerid uuid ip name model isplayer displaytype canpoweroff connected power volume)
 
 (defun squeeze-string-plistify (string start end)
+  (unless end
+    (setq end (length string)))
   (save-match-data
     (let (result)
       (loop
              (when (> mend end)
                (return))
              (push (intern (format ":%s" (substring string (match-beginning 1) (match-end 1)))) result)
-             (push (url-unhex-string (substring string (match-beginning 2) (match-end 2))) result)
+             (push (decode-coding-string
+                    (url-unhex-string (substring string (match-beginning 2) (match-end 2)))
+                    'utf-8)
+                   result)
              (setq start mend))
          (return)))
       (nreverse result))))