From: Christophe Rhodes Date: Thu, 16 Oct 2014 13:33:19 +0000 (+0100) Subject: a couple of robustification fixes X-Git-Url: http://christophe.rhodes.io/gitweb/?a=commitdiff_plain;h=c25024a3a63e4e6bf71f882d2e8697c831dd3a91;p=squeeze-el.git a couple of robustification fixes - let squeeze-string-plistify handle a nil `end' parameter - decode the url-unhexified string as utf-8 --- diff --git a/squeeze.el b/squeeze.el index cdfb86d..1e34449 100644 --- a/squeeze.el +++ b/squeeze.el @@ -329,6 +329,8 @@ 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 @@ -337,7 +339,10 @@ (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))))