Sometimes the problem is obvious, but often it is not. For example, here is my latest error message:
dpkg-query: error: parsing file '/var/lib/dpkg/status' near line 7848 package 'fontconfig': field name `There is no ` character anywhere near line 7848, field name or otherwise.
The easiest solution to this, and similar, issues is to remove the whole section belonging to the package named. So in this case I remove everything starting at the line containing
Package: fontconfigdown to, and including, the next blank line.
But wow apt/dpkg no longer no longer knows the status of your fontconfig package. The easiest way to solve that is just re-install it. (sudo apt-get install fontconfig)
Make a backup of the status file first, if you're nervous.