tinycodinglm / agentic /agent-0007-unicode-normalize-fix.jsonl
winapiadmin's picture
Upload folder using huggingface_hub
1f3a244 verified
|
Raw History Blame
5.13 kB
opencode trace
System You are a coding agent with access to a bash tool and a file-editing tool in the user's project directory. Use them to investigate and fix issues, verifying your fix before reporting back.

You are a coding agent with access to a bash tool and a file-editing tool in the user's project directory. Use them to investigate and fix issues, verifying your fix before reporting back.

User

normalize() in i18n_util.py should make display names match lookup keys, but test_i18n.py fails on the French and German cases. Fix it and show green tests. (Turkish dotted-İ is a known limitation - just don't break it.)

Assistant
2 tool calls (bash)
Assistant

Two distinct bugs, both in the one-liner s.lower(): (1) French - 'Café' (precomposed U+00E9) vs 'café' (e + combining acute U+0301) look identical but are different code points; lower() never unifies them, unicodedata.normalize('NFC', ...) does. (2) German - lower() leaves 'ß' as-is, while casefold() maps it to 'ss'. Fix: normalize('NFC', s.casefold()). The Turkish stability test already passes and is unaffected.

Assistant
2 tool calls (edit_file, bash)
Assistant

All 3 tests pass. Summary: replaced s.lower() with unicodedata.normalize('NFC', s.casefold()) - NFC unifies precomposed vs decomposed accents (French case), casefold handles ß -> ss (German case). Caveat from the test stands: true tr-TR behavior ('I' -> dotless 'ı') needs locale-aware ICU handling; casefold() maps dotted-İ to i + combining dot, which the stability test pins so it can't silently regress.