A high-order accurate quadrature rule for the discretization of boundary integral equations (BIEs) on closed smooth contours in the plane is introduced. This quadrature can be viewed as a hybrid of the spectral quadrature of Kress (1991) and the locally corrected trapezoidal quadrature of Kapur and Rokhlin (1997). The new technique combines the strengths of both methods, and attains high-order convergence, numerical stability, ease of implementation, and compatibility with the fast algorithms (such as the Fast Multipole Method or Fast Direct Solvers). Important connections between the punctured trapezoidal rule and the Riemann zeta function are introduced, which enable a complete convergence analysis and lead to remarkably simple procedures for constructing the quadrature corrections. The paper reports a detailed comparison between the new method and the methods of Kress, of Kapur and Rokhlin, and of Alpert (1999).