Normalizes strings before comparison