escape string in defattr (closes #3620)