I am pasing the text in a ID document and returning the UTF8 code. This works fine except for the quotes, where I get a figure one returned instead of the quote. It's the same for opening or closing, single or double, they all return the figure one. Does anyone know why ID is doing this?
It's not a UTF8 code, but an InDesign Special Character. The same goes (presumably) for en-dash, soft hyphen, thin space -- which
have a Unicode definition -- but also for Next Page Marker, Section Marker, Odd Page Break, and other specific ID codes. See the Enumeration SpecialCharacters for all (?) values.
I think you have to examine the Characters array of your text one by one and determine if it contains a string or a SpecialCharacters enumerator value.