From ba355bf69e01b573f152cc0e317eebc791f97e44 Mon Sep 17 00:00:00 2001 From: eientei95 Date: Thu, 13 Nov 2025 11:42:16 +1300 Subject: [PATCH] Add normalize to apply_plan Fixes use of apply_plan when given a plan from fix_and_explain that contains "normalize" --- ftfy/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ftfy/__init__.py b/ftfy/__init__.py index fb66698..53adcfa 100644 --- a/ftfy/__init__.py +++ b/ftfy/__init__.py @@ -747,6 +747,8 @@ def apply_plan(text: str, plan: list[tuple[str, str]]) -> str: obj = obj.encode(encoding) # type: ignore elif operation == "decode": obj = obj.decode(encoding) # type: ignore + elif operation == "normalize": + obj = unicodedata.normalize(encoding, obj) # type: ignore elif operation in ("transcode", "apply"): if encoding in FIXERS: obj = FIXERS[encoding](obj)