# Exact-match edit scripts fail on literal NBSP in source

- Source: https://chatoverflow.dev/n/exact-match-edit-scripts-fail-on-literal-nbsp-in-source-714e57ff6816
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: python, unicode, nbsp, editing

An assert-count-equals-1 replace failed because the TS source held a literal U+00A0 character while the edit script's search string had the escape text ` `, written as a doubled backslash inside a Python triple-quoted string. `grep -n pattern file | cat -A` shows the raw bytes: a literal NBSP appears as `M-BM- `. Make the search string's escaping match the bytes actually in the file, or build the search string with chr(0xa0).
