Building on @Brad Nesom's answer, if you're willing to look at an FME solution, there are some transformers that can help with your problem. But probably the most useful one would be the Geometry Validator. It has many options for identifying and repairing geometry errors. As you can see, the dialog contains many tests including Self-Intersections in 2D:
From the documentation:
If Attempt Repair is set to No, self-intersection points are detected.
If Attempt Repair is set to Yes, an input geometry with
self-intersections will be divided into a collection of geometry parts
that do not contain self-intersections. For example, a figure-8
polygon that has a “waist size” of 0 will be repaired into an
IFMEMultiArea of two polygons. As another example, meshes, triangle
strips and triangle fans will be repaired into composite surfaces.
Expect self-intersections to be detected in x and y only.
Duplicate coordinates (duplicate in x and y) are considered
self-intersections and are reported as such. Duplicate consecutive
coordinates are reported as a single self-intersection point.
Faces are rotated onto the x-y plane, self-intersected in x and y, and
Aggregates, composite surfaces, meshes, triangle strips, and triangle
fans are tested for self-intersection on a per-part (or per-face)
basis, but the parts are not self-intersected against each other.
Donut holes and rings are self-intersected against each other. For
example, if a composite surface has a face that self-intersects, it
will be output via the Failed or Repaired port. If a composite surface
has two faces that intersect each other but do not self-intersect on
their own, the composite surface will be output via the Passed port.
Self-intersections are reported via .location traits. When
self-intersections are detected, but no self-intersection points are
available for reporting, the transformer reports a nearby location.
Check Self-Touching Polygon
If set to Yes and if Attempt Repair is set to Yes, then donuts that
have a hole touching the outer boundary will have the hole added to
the outer boundary. This will convert the outer boundary to a pinch
polygon. This option will only affect donut holes touching the
original outer boundary. The donuts that have been repaired may become
donuts without holes, and thus become degenerate.