print_select, print_select_hash: remove line endings and other special symbols (closes #593)