  In this paper we propose and analyze a general arbitrarily high-order
modified trapezoidal rule for a class of weakly singular integrals of the forms
$I = \int_{\mathbb{R}^n}\phi(x)s(x)dx$ in $n$ dimensions, where $\phi\in
C_c^N(\mathbb{R}^n)$ for some sufficiently large $N$ and $s$ is the weakly
singular kernel. The admissible class of weakly singular kernel requires $s$
satisfies dilation and symmetry properties and is large enough to contain
functions of the form $\frac{P(x)}{|x|^r}$ where $r > 0$ and $P(x)$ is any
monomials such that $\text{deg} P < r < \text{deg} P + n$. The modified
trapezoidal rule is the singularity-punctured trapezoidal rule added by
correction terms involving the correction weights for grid points around
singularity. Correction weights are determined by enforcing the quadrature rule
exactly evaluates some monomials and solving corresponding linear systems. A
long-standing difficulty of these type of methods is establishing the
non-singularity of the linear system, despite strong numerical evidences. By
using an algebraic-combinatorial argument, we show the non-singularity always
holds and prove the general order of convergence of the modified quadrature
rule. We present numerical experiments to validate the order of convergence.
