Universal properties of boundary and interface charges in continuum models of one-dimensional insulators