From 5aa9f8f2cdb7685870218ff5a29a4a9e1b7c6f91 Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Fri, 18 Sep 2009 13:59:50 -0400 Subject: [PATCH] Unicode support for tags + sqlite --- templates/tagging_common.mako | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/tagging_common.mako b/templates/tagging_common.mako index 68c931dece4..65ba96c0125 100644 --- a/templates/tagging_common.mako +++ b/templates/tagging_common.mako @@ -13,7 +13,11 @@ tag_value = "" if tag.value is not None: tag_value = tag.user_value - tag_names_and_values[unicode(tag_name, 'utf-8')] = unicode(tag_value, 'utf-8') + ## Tag names and values may be string or unicode object. + if isinstance( tag_name, str ): + tag_names_and_values[unicode(tag_name, 'utf-8')] = unicode(tag_value, 'utf-8') + else: ## isInstance( tag_name, unicode ): + tag_names_and_values[tag_name] = tag_value %> // // Returns the number of keys (elements) in an array/dictionary.