Commits

Erik Grinaker  committed 6691f6a

fix unicode-issues

  • Participants
  • Parent commits 4676a19

Comments (0)

Files changed (5)

 
 	* don't use unneeded defsfiles when building gnomemisc module
 
+	* encode data as Unicode when loading from files
+
+	* fix crash when searching with non-Unicode locale
+
 2005-08-09  Erik Grinaker <erikg@codepoet.no>
 
 	* fix incorrect magic string in MIME-type entry
 ============================
 
 Bugfixes:
+- fix crash when searching with non-Unicode locale
+- encode data as Unicode when loading from files
 - fix incorrect magic string in MIME-type entry
 - set correct app version number in datafile header
 - default lock timeout for applet set to 10 minutes
 - use icons instead of colors in password entry to indicate strength
   (see: epiphany address entry)
 - investigate crashes under fc3 (with dags packages)
-- fix applet crash when using iso-8859-1 in entry
 
 0.5.x:
 - ensure complete UTF-8 support

File src/lib/data.py

 
 		# run the search
 		for item in items:
-			if self.casesensitive == True and item.find(string) >= 0:
+			if self.casesensitive == True and string in item:
 				return True
 
-			elif self.casesensitive == False and item.lower().find(string.lower()) >= 0:
+			elif self.casesensitive == False and string.decode("utf-8").lower() in item.decode("utf-8").lower():
 				return True
 
 		return False

File src/lib/util.py

 
 	for child in node.childNodes:
 		if child.nodeType == node.TEXT_NODE:
-			text += child.nodeValue
+			text += child.nodeValue.encode("utf-8")
 
 	return text