Index: pykota/trunk/pykota/tool.py
===================================================================
--- pykota/trunk/pykota/tool.py (revision 2795)
+++ pykota/trunk/pykota/tool.py (revision 2804)
@@ -236,4 +236,30 @@
         """Returns the charset in use."""
         return self.charset
+        
+    def UTF8ToUserCharset(self, text) :
+        """Converts from UTF-8 to user's charset."""
+        if text is not None :
+            try :
+                return unicode(text, "UTF-8").encode(self.charset) 
+            except UnicodeError :    
+                try :
+                    # Incorrect locale settings ?
+                    return unicode(text, "UTF-8").encode("ISO-8859-15") 
+                except UnicodeError :    
+                    pass
+        return text
+        
+    def userCharsetToUTF8(self, text) :
+        """Converts from user's charset to UTF-8."""
+        if text is not None :
+            try :
+                return unicode(text, self.charset).encode("UTF-8") 
+            except UnicodeError :    
+                try :
+                    # Incorrect locale settings ?
+                    return unicode(text, "ISO-8859-15").encode("UTF-8") 
+                except UnicodeError :    
+                    pass
+        return text
         
     def display(self, message) :
Index: pykota/trunk/pykota/storage.py
===================================================================
--- pykota/trunk/pykota/storage.py (revision 2801)
+++ pykota/trunk/pykota/storage.py (revision 2804)
@@ -646,27 +646,9 @@
     def databaseToUserCharset(self, text) :
         """Converts from database format (UTF-8) to user's charset."""
-        if text is not None :
-            try :
-                return unicode(text, "UTF-8").encode(self.tool.getCharset()) 
-            except UnicodeError :    
-                try :
-                    # Incorrect locale settings ?
-                    return unicode(text, "UTF-8").encode("ISO-8859-15") 
-                except UnicodeError :    
-                    pass
-        return text
+        return self.tool.UTF8ToUserCharset(text)
         
     def userCharsetToDatabase(self, text) :
         """Converts from user's charset to database format (UTF-8)."""
-        if text is not None :
-            try :
-                return unicode(text, self.tool.getCharset()).encode("UTF-8") 
-            except UnicodeError :    
-                try :
-                    # Incorrect locale settings ?
-                    return unicode(text, "ISO-8859-15").encode("UTF-8") 
-                except UnicodeError :    
-                    pass
-        return text
+        return self.tool.userCharsetToUTF8(text)
         
     def cleanDates(self, startdate, enddate) :    
Index: pykota/trunk/bin/pknotify
===================================================================
--- pykota/trunk/bin/pknotify (revision 2802)
+++ pykota/trunk/bin/pknotify (revision 2804)
@@ -152,5 +152,5 @@
     def sanitizeMessage(self, msg) :
         """Replaces \\n and returns a messagee in xmlrpclib Binary format."""
-        return xmlrpclib.Binary(msg.replace("\\n", "\n"))
+        return xmlrpclib.Binary(self.userCharsetToUTF8(msg.replace("\\n", "\n")))
         
     def convPAM(self, auth, queries=[], userdata=None) :
@@ -243,5 +243,6 @@
                     if options["checkauth"] :
                         if ("username" in varnames) and ("password" in varnames) :
-                            if self.checkAuth(result["username"].data, result["password"].data) :
+                            if self.checkAuth(self.UTF8ToUserCharset(result["username"].data[:]), 
+                                              self.UTF8ToUserCharset(result["password"].data[:])) :
                                 authok = "AUTH=YES"
                             else :    
@@ -252,5 +253,5 @@
                         if (varname != "password") \
                            and ((varname != "username") or (authok in (None, "AUTH=YES"))) :
-                            print "%s=%s" % (varname.upper(), result[varname].data)
+                            print "%s=%s" % (varname.upper(), self.UTF8ToUserCharset(result[varname].data[:]))
                     if authok is not None :        
                         print authok        
@@ -275,5 +276,5 @@
     try :
         defaults = { \
-                     "denyafter" : 1,
+                     "denyafter" : 0,
                      "timeout" : 0,
                    }
