I know it is possible to avoid purple fringing using post-processing software's chromatic aberration correction capabilities but I have a few pictures where the one I'm using (Rawtherapee on Linux) cannot fully remove it.
Most of the pictures where I experienced a lot of PF are taken against the light from sunset reflecting into water. Generally it is not visible on the JPEG preview of the camera so I suppose it may be caused by rawtherapee not being as efficient as camera and/or Adobe Lightroom post-processing. However for a few pictures it is so strong that even the camera JPEG preview experience a lot of PF.
For example this picture where all lights should be white is the JPEG extracted from the raw file produced by camera with a Nikkor 50mm 1.8 and I have the exact same result using a Nikkor DX 35mm 1.8:
So my question is how to avoid those PF, or at least how to minimize them before post-processing (i.e. before or when shooting). When shooting against sunlight can a polarizing filter help? I also read that some UV filters seems to be able to reduce them. What about them? And also what could I do for something like the above picture taken at night?