More context: If you're able to open the charger up, usually there's a transformer inside (the newer small ones as well), so basically a bunch of copper windings around an iron ring or block (may be laminated). If you can not find a transformer on the board wit at least 4 wires sticking out (to the board), it's certainly not isolated. Having one with at least 4 wires coming out is no certainty, but chargers not having one should be in the trash.
A simpler, less destructive (for isolated chargers), test is to plug it in and touch a grounded metal object (like a tap, faucet, microwave case, etc) with the metal ending of the usb plug. If it's a bad charger, either of 3 things should happen: the ground breaker of your house trips, the charger goes up in smoke, or the charger simply gets warm. (edited)