[bug][31878] Proper escaping. Fixes #3894