We study single-channel continuum models of one-dimensional insulators induced by periodic potential modulations which are either terminated by a hard wall (the boundary model) or feature a single region of dislocations and/or impurity potentials breaking translational invariance (the interface model). We investigate the universal properties of excess charges accumulated near the boundary and the interface, respectively. We find a rigorous analytic proof for the earlier observed linear dependence of the boundary charge on the phase of the periodic potential modulation as well as extend these results to the interface model. The linear dependence on the phase shows a universal value for the slope, and is intersected by discontinuous jumps by plus or minus one electron charge at the phase points where localized states enter or leave a band of extended states. Both contributions add up such that the periodicity of the excess charge in the phase over a $2\pi$-cycle is maintained. While in the boundary model this property is usually associated with the bulk-boundary correspondence, in the interface model a correspondence of scattering state and localized state contributions to the total interface charge is unveiled on the basis of the so-called nearsightedness principle.