It is literally impossible for all PDFs, since some of them may not have any kind of semantic structure and consist of a set of graph bitmaps laid out at specific coordinates to make up blocks of text.
Infuriating.
There might be some Latin script fonts that cause problems, but I haven't looked into that very much--I do recall we had problems with an italic font.
But the point that I was not so clearly trying to make was that sometimes the messed up encoding is intentional and not a bug.