Fix bug with too aggressive Unicode escape sequences

Fixes #1308