pH controlled assembly of a self-complementary halogen-bonded dimer