  This paper studies a polymer chain in the vicinity of a linear interface
separating two immiscible solvents. The polymer consists of random monomer
types, while the interface carries random charges. Both the monomer types and
the charges are given by i.i.d. sequences of random variables. The
configurations of the polymer are directed paths that can make i.i.d.
excursions of finite length above and below the interface. The Hamiltonian has
two parts: a monomer-solvent interaction ("copolymer") and a monomer-interface
interaction ("pinning"). The quenched and the annealed version of the model
each undergo a transition from a localized phase (where the polymer stays close
to the interface) to a delocalized phase (where the polymer wanders away from
the interface). We exploit the approach developed in [5] and [3] to derive
variational formulas for the quenched and the annealed free energy per monomer.
These variational formulas are analyzed to obtain detailed information on the
critical curves separating the two phases and on the typical behavior of the
polymer in each of the two phases. Our main results settle a number of open
questions.
