The polycondensation reaction is carried out, for example, in a solvent which assists quaternisation reactions, or in a mixture of such solvents, such as water, dimethylformamide, acetone, methyl ethyl ketone, acetonitrile and lower alcohols, in particular methanol.