Hi,
I have an infopath form where users will frequently copy and paste text from a word document or .pdf file into both standard text boxes and rich text boxes. The form allows the user to input the text and save the infopath form however sometimes when you re-open the form there is an error such as this
The form contains XML that cannot be parsed:
An invalid character was found in text content.
Line 6, Position 9
The Fund
--------^
The text should read: The Fund's
I am able to edit the xml file using notepad and find the offending character which is usually an apostrophe, quotation marks, French or German accents on letters and empty spaces. If I remove the character(s) I am able to open the file in infopath. As an alternative to replacing the characters, I can also open the file and ensure that in the first line <?xml version="1.0"?> or <?xml version="1.0" encoding="UTF-8"?> is replaced with <?xml version="1.0" encoding="iso-8859-1" ?>.
Now I could go through each one of my .xml data files and make that replacement but firstly, as i understand it, UTF-8 is the preferred method to encode xml and iso-8859-1 is being phased out, and secondly I would have to go and make the replacement every time a user creates a brand new xml file using the infopath form because I don't know how to change the default encoding from UTF-8 to iso-8859-1.
What would be better is if these characters could be automatically converted or some validation came up to warn the user that one of the character they have entered is not going to work.
Here - ' - is an example of one of the characters. However, it appears differently in notepad than it looks in this message. It is a more shaped (i.e. like a tear drop) apostrophe rather than the straight line apostrophe - ' - that I get if I press the apostrophe key on my keyboard.
Can anybody give me more details on why I am experiencing this problem and what the best solution to it would be?
Many thanks,
Jamie