(unicodeText, maxLength)
| 279 | |
| 280 | |
| 281 | def truncateText(unicodeText, maxLength): |
| 282 | try: |
| 283 | unicodeText = unicodeText.decode('utf-8') |
| 284 | except: |
| 285 | pass |
| 286 | |
| 287 | try: |
| 288 | return str(unicodeText.encode("utf-8"), "utf-8", errors="ignore")[:maxLength] |
| 289 | except: |
| 290 | pass |
| 291 | return "" |
| 292 | |
| 293 | |
| 294 | def splitText(unicodeText, maxLength): |
no outgoing calls
no test coverage detected