Returns a copy with all keys and values de- or recoded to match :attr:`input_encoding`. Some libraries (e.g. WTForms) want a unicode dictionary.
(self, encoding=None)
| 1914 | return s |
| 1915 | |
| 1916 | def decode(self, encoding=None): |
| 1917 | ''' Returns a copy with all keys and values de- or recoded to match |
| 1918 | :attr:`input_encoding`. Some libraries (e.g. WTForms) want a |
| 1919 | unicode dictionary. ''' |
| 1920 | copy = FormsDict() |
| 1921 | enc = copy.input_encoding = encoding or self.input_encoding |
| 1922 | copy.recode_unicode = False |
| 1923 | for key, value in self.allitems(): |
| 1924 | copy.append(self._fix(key, enc), self._fix(value, enc)) |
| 1925 | return copy |
| 1926 | |
| 1927 | def getunicode(self, name, default=None, encoding=None): |
| 1928 | ''' Return the value as a unicode string, or the default. ''' |
no test coverage detected