Apply just the encoding-fixing steps of ftfy to this text. Returns the fixed text, discarding the explanation. >>> fix_encoding("ó") 'ó' >>> fix_encoding("ó") 'ó'
(
text: str, config: TextFixerConfig | None = None, **kwargs: Any
)
| 584 | |
| 585 | |
| 586 | def fix_encoding( |
| 587 | text: str, config: TextFixerConfig | None = None, **kwargs: Any |
| 588 | ) -> str: |
| 589 | """ |
| 590 | Apply just the encoding-fixing steps of ftfy to this text. Returns the |
| 591 | fixed text, discarding the explanation. |
| 592 | |
| 593 | >>> fix_encoding("ó") |
| 594 | 'ó' |
| 595 | >>> fix_encoding("ó") |
| 596 | 'ó' |
| 597 | """ |
| 598 | if config is None: |
| 599 | config = TextFixerConfig(explain=False) |
| 600 | config = _config_from_kwargs(config, kwargs) |
| 601 | fixed, _explan = fix_encoding_and_explain(text, config) |
| 602 | return fixed |
| 603 | |
| 604 | |
| 605 | # Some alternate names for the main functions |
no test coverage detected