Free Support Forum - aspose.com

Problem escaping double quotes when upgrading to latest version

Hello,



We’re upgrading a project from aspose version: ’15.10.0.0’ to version ’17.3.0.0’.



However upon running our unit tests I’ve noticed an issue with the documents containing an escaped double quote.



In attachment you can find the expectation for our unit test and our actual result.



As you can see the expectation correctly escapes the double quote by using ‘\”’. The result would be a double quote ‘”’.



However when merging the document now the double quote and the backslash that is needed to escape it stays put. Our result now has ‘\”’ instead of the expected ‘”’.



I managed to pinpoint the problem to the UpdateFields node…

When I call UpdateFields for the same document (check the documents OldVersion_BeforeUpdateFields and NewVersion_BeforeUpdateFields, they are the same.)



The result changes depending on which aspose version was used. I added the document.xml of the word document. You can see that in one document using the old version of aspose the result is ” the other document using the new version of aspose has \” as a result



Did something happen with escaping double quotes?

How are we supposed to escape double quotes?



Thanks in advance for the information!



Kind regards,



KrisG

Hi Kris,


Thanks for your inquiry. We have tested the scenario with your shared documents using Aspose.Words for .NET 17.3 and 15.10. We noticed the reported issue of escape character() in Mail Merge field, so logged a ticket WORDSNET-15122 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,

The issues you have found earlier (filed as WORDSNET-15122) have been fixed in this Aspose.Words for .NET 17.5 update and this Aspose.Words for Java 17.5 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,

When upgrading to a new version we noticed this issue is still not resolved.

The result we want and had with an older version (’15.10.0.0’) from aspose as explained in the first post:
“dit stelde geen vraag. :-(”

the result we got from version ‘17.3.0.0’’ (as explained in the first post of this thread) of aspose used to be:
“dit stelde geen vraag. :-(”

And after upgrading to the latest version of aspose (’17.6.0.0’) where this was supposed to be fixed we get this:

“dit stelde geen vraag. :-(”

So the first quote is escaped properly but the last quote is not.
Could you verify this?

The issue is the same as the original post in this topic.

Kind Regards,
KrisG

@krisg

We are sorry for the confusion. It is not a bug but expected behavior. Please note If IF field contains backslash as last character MS word also retains it. Earlier, we have updated this behavior in 16.5 to mimic MS Word, so you get different results in 15.10. However, we have fixed backslash as first character in the argument in 17.5. So now Aspose.Words produces same result as MS Word does.

“dit stelde geen vraag. :-(”

Best Regads,