parameters: (self, val, encoding=None, str=str, **kw)
docstring: Pass Unicode strings through unmolested, unless an encoding is specified.
docstring_summary: Pass Unicode strings through unmolested, unless an encoding is specified.
docstring_tokens: Pass Unicode strings through unmolested unless an encoding is specified .
function: def filter(self, val, encoding=None, str=str, **kw):
          '''
              Pass Unicode strings through unmolested, unless an encoding is specified.
          '''
          if val is None:
              return u''
          if isinstance(val, unicode):
              # ignore the encoding and return the unicode object
              return val
          else:
              try:
                  return unicode(val)
              except UnicodeDecodeError:
                  # we could put more fallbacks here, but we'll just pass the str
                  # on and let DummyTransaction worry about it
                  return str(val)
function_tokens: def filter ( self , val , encoding = None , str = str , * * kw ) : if val is None : return u'' if isinstance ( val , unicode ) : # ignore the encoding and return the unicode object return val else : try : return unicode ( val ) except UnicodeDecodeError : # we could put more fallbacks here, but we'll just pass the str # on and let DummyTransaction worry about it return str ( val )