  We generalize Macdonald's formula for the cohomology of Hilbert schemes of
points on a curve from smooth curves to curves with planar singularities: we
relate the cohomology of the Hilbert schemes to the cohomology of the
compactified Jacobian of the curve. The new formula is a consequence of a
stronger identity between certain perverse sheaves defined by a family of
curves satisfying mild conditions. The proof makes an essential use of Ngo's
support theorem for compactified Jacobians and generalizes this theorem to the
relative Hilbert scheme of such families. As a consequence, we generalize part
of the Weil conjectures to the Hilbert-zeta function of curves with planar
singularities.
