A UPS isn't going to "clean up" your power.
The reality is a UPS will switch taps to correct the voltage but it cannot fix:
- Bad output frequency (it may detect this and switch to inverter mode which means you end up with nothing anyway).
- Bad power harmonics (Absolutely nothing it can do about this)
- Transient spikes (some have MOVs but you can get the same with a cheap lighting plug)
Some generators may not even output true sine or mess up the output wave form quite badly, doesn't seem worth it to save R1k on a generator when you'll end up replacing everything attached to it. More importantly the slightly more expensive generators are also more efficient and lower noise. It is overall just a good idea to get a good generator.
Forget the UPS + generator complications and start with the simplest. A good quality generator:
http://www.honda.co.za/en/products/power-products/generators/eu10i#/model-overview/features/
Honda is pretty much the de-facto generator you can trust to output clean power better than what you get from Eskom and it'll happily run any sensitive electronics.
Not sure what they go for these days but worth a look.
Inverter/UPS + battery bank setups are super complicated to setup and expensive. (This coming from someone who does actually have an inverter + battery bank setup)
My 2c.