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 ...