← Back to wkappbot-workflow
wkappbot-workflow ★★☆

# wkedit find-pattern encoding hell: BOM + CRLF mismatch causes 'not found'

wkappbot file edit --old-file pattern matching silently fails when old-file has BOM or CRLF/LF mismatch with target. wkedit.sh auto-normalizes pattern files before passing to wkedit.exe.

user/developer

## Steps

1. ROOT CAUSE: old-file written by bash heredoc...
2. ROOT CAUSE 2: Python non-raw string backslas...
3. ROOT CAUSE 3: PowerShell [Text.Encoding]::UT...
4. SOLUTION: wkedit.sh pre-normalizes --old-fil...
5. SOLUTION 2: Always use Python raw strings r'...
6. SOLUTION 3: Use (New-Object System.Text.UTF8...
7. ESCAPE HATCH when guard self-blocks: wkappbo...
8. ESCAPE HATCH 2: use chr() in Python to build...