there is no such thing as a mechanical driven generator head with square wave output
what you did was buy a cheap generator that did not have an AVR (automatic voltage regulation) for field regulation,
what it did have was a capacitor & diode setup, these are OK for operating motors
but have a nasty spike in the sine wave form when the rotor crosses from one winding to the next reversing the current flow
and your ups which depends on voltage drop sensing to know when to switch to battery power, was totally confused
the switching power supplies in your PC would probably handled it oK
but i don't know WHAT other electronics you are talking about so i can't comment on those
things people fail to realize, is most sensitive electronics aka consumer electronics is NOT so sensitive, not affected by minor voltage variations or electronic noise, ( not like medical equipment measuring minute electrical signals in the body )
and a UPS is to prevent data loss, give shut down time, not protect from power line surges, for that you line conditioning and transient suppression
neither of which is needed with a generator
because a generator is NOT affect by outside interference like lighting on the power pole
IF your generator ever got hit by lighting, you would have a lot more to worry about than your electronics
to sum it up
if your UPS doesn't like the generator power
unplug the UPS, take it out of the circuit and use the generator with out, it is very doubtful that your 'electronics' will be harmed by temporary use of generator power with out the UPS inline