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)
| 2203 | return s |
| 2204 | |
| 2205 | def decode(self, encoding=None): |
| 2206 | """ Returns a copy with all keys and values de- or recoded to match |
| 2207 | :attr:`input_encoding`. Some libraries (e.g. WTForms) want a |
| 2208 | unicode dictionary. """ |
| 2209 | copy = FormsDict() |
| 2210 | enc = copy.input_encoding = encoding or self.input_encoding |
| 2211 | copy.recode_unicode = False |
| 2212 | for key, value in self.allitems(): |
| 2213 | copy.append(self._fix(key, enc), self._fix(value, enc)) |
| 2214 | return copy |
| 2215 | |
| 2216 | def getunicode(self, name, default=None, encoding=None): |
| 2217 | """ Return the value as a unicode string, or the default. """ |
no test coverage detected