  The goal of this paper is to construct a nonlinear Fourier transformation on
the space of symbols of compact Hankel operators on the circle. This
transformation allows to solve a general inverse spectral problem involving
singular values of a compact Hankel operator, with arbitrary multiplicities.
The formulation of this result requires the introduction of the pair made with
a Hankel operator and its shifted Hankel operator. As an application, we prove
that the space of symbols of compact Hankel operators on the circle admits a
singular foliation made of tori of finite or infinite dimensions, on which the
flow of the cubic Szeg\"o equation acts. In particular, we infer that arbitrary
solutions of the cubic Szeg\"o equation on the circle with finite momentum are
almost periodic with values in H^{1/2}(S ^1).
