scossu 2 месяцев назад
Родитель
Сommit
bc8533cdc7
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      scriptshifter/trans.py

+ 5 - 1
scriptshifter/trans.py

@@ -348,7 +348,11 @@ def _normalize_src(ctx, norm_rules):
     # In using diacritics, LC standards prefer the decomposed form (combining
     # diacritic + base character) to the pre-composed form (single Unicode
     # symbol for the letter with diacritic).
-    ctx._src = precomp_normalize("NFD", ctx.src)
+    #
+    # Note: only safe for R2S.
+    if ctx.t_dir == FEAT_R2S:
+        logger.debug("Normalizing pre-composed symbols.")
+        ctx._src = precomp_normalize("NFD", ctx.src)
 
     for nk, nv in norm_rules.items():
         ctx._src = ctx.src.replace(nk, nv)