During my study of Finite Model Theory I found that usually purely relational structure say $\mathcal{M} = \langle A, R_1,\ldots,R_k \rangle$ are encoded as
$0^n1$#$\operatorname{enc}(R_1)$#$\operatorname{enc}(R_2)$#$\ldots$#$\operatorname{enc}(R_k)$
where n is the size of universe A and each $\operatorname{enc}(R_i)$ is a binary string of length $n^{m_i}$ for $1 \leq i \leq k$ and $m_i$ being arity of each relation $R_i$. Any position j of such binary string is $1$ iff corresponding $m_i$-tuple (from set of lexicographically ordered $A^{m_i}$) belongs to relation set $R^{m_i}$ and $0$ otherwise.
My concern is how we encode any first-order formula $\phi$ using strings of symbols recognised by Turing machine.