Issue #1378: Escape special characters for better output