Encode special characters found in string I{s}. @param s: A string to encode. @type s: str @return: The encoded string. @rtype: str
(self, s)
| 63 | return False |
| 64 | |
| 65 | def encode(self, s): |
| 66 | """ |
| 67 | Encode special characters found in string I{s}. |
| 68 | @param s: A string to encode. |
| 69 | @type s: str |
| 70 | @return: The encoded string. |
| 71 | @rtype: str |
| 72 | """ |
| 73 | if isinstance(s, str) and self.needsEncoding(s): |
| 74 | for x in self.encodings: |
| 75 | s = re.sub(x[0], x[1], s) |
| 76 | return s |
| 77 | |
| 78 | def decode(self, s): |
| 79 | """ |
no test coverage detected