code: def to_unicode(obj, encoding='utf-8'):
      
      if isinstance(obj, basestring):
          if not isinstance(obj, unicode):
              obj = unicode(obj, encoding)
      return obj
docs: Convert obj to unicode (if it can be be converted)
  
      from http://farmdev.com/talks/unicode/