replace characters with constants