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)
| 2601 | return s |
| 2602 | |
| 2603 | def decode(self, encoding=None): |
| 2604 | """ Returns a copy with all keys and values de- or recoded to match |
| 2605 | :attr:`input_encoding`. Some libraries (e.g. WTForms) want a |
| 2606 | unicode dictionary. """ |
| 2607 | copy = FormsDict() |
| 2608 | enc = copy.input_encoding = encoding or self.input_encoding |
| 2609 | copy.recode_unicode = False |
| 2610 | for key, value in self.allitems(): |
| 2611 | copy.append(self._fix(key, enc), self._fix(value, enc)) |
| 2612 | return copy |
| 2613 | |
| 2614 | def getunicode(self, name, default=None, encoding=None): |
| 2615 | """ Return the value as a unicode string, or the default. """ |
no test coverage detected