encoding name for url and adding title attribute