Anodic oxidation of halides in anhydrous acetic acid