[cl-xmpp-cvs] CVS update: cl-xmpp/cxml.lisp cl-xmpp/utility.lisp

Erik Enge eenge at common-lisp.net
Mon Nov 14 19:42:30 UTC 2005


Update of /project/cl-xmpp/cvsroot/cl-xmpp
In directory common-lisp.net:/tmp/cvs-serv13651

Modified Files:
	cxml.lisp utility.lisp 
Log Message:
fixing character issues for lisps without 16 bit wide characters

Date: Mon Nov 14 20:42:29 2005
Author: eenge

Index: cl-xmpp/cxml.lisp
diff -u cl-xmpp/cxml.lisp:1.5 cl-xmpp/cxml.lisp:1.6
--- cl-xmpp/cxml.lisp:1.5	Sat Nov 12 05:20:21 2005
+++ cl-xmpp/cxml.lisp	Mon Nov 14 20:42:29 2005
@@ -19,7 +19,7 @@
 (defmethod sax:start-element ((handler stanza-handler) uri lname qname attrs)
   (declare (ignore uri lname))
   (when (eql (depth handler) 0)
-    (if (string-equal "stream:stream" qname)
+    (if (eq :stream\:stream (ensure-keyword qname))
         ;; Create an element for DOM-TO-EVENT so we don't have to have
         ;; any specialized code just to handle stream:stream.
         (let* ((document (dom:create-document))


Index: cl-xmpp/utility.lisp
diff -u cl-xmpp/utility.lisp:1.8 cl-xmpp/utility.lisp:1.9
--- cl-xmpp/utility.lisp:1.8	Mon Nov 14 16:14:07 2005
+++ cl-xmpp/utility.lisp	Mon Nov 14 20:42:29 2005
@@ -1,4 +1,4 @@
-;;;; $Id: utility.lisp,v 1.8 2005/11/14 15:14:07 eenge Exp $
+;;;; $Id: utility.lisp,v 1.9 2005/11/14 19:42:29 eenge Exp $
 ;;;; $Source: /project/cl-xmpp/cvsroot/cl-xmpp/utility.lisp,v $
 
 ;;;; See the LICENSE file for licensing information.
@@ -41,3 +41,9 @@
 
 (defun add-auth-method (name operator)
   (push (list name operator) *auth-methods*))
+
+(defun ensure-keyword (thing)
+  (cond
+   ((typep thing 'string) (intern thing :keyword))
+   ((typep thing 'array) (ensure-keyword (map 'string #'code-char thing)))
+   (t (error "Don't know how to make keyword out of: ~a (type: ~a)" thing (type-of thing)))))
\ No newline at end of file




More information about the Cl-xmpp-cvs mailing list