Ampersands reformatting to # 038; and breaking links

I am using Woocommerce with affiliate links and the external urls are in the format

The ampersands are being translated into # 038; ( which stops the link from working.

How can I stop this happening? In an ideal world I want none of this formatting applying to hyperlinks.