Electrolysis of hydrochloric acid solution with indicator