We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Apostrophe(quotation mark) extracted from word document is not the same as mysql database

I have a program which extracts headings from word documents and uses a database to see if all the strings from the database exist in the word document. My problem is that there is one heading with a apostrophe(quotation mark) and the extracted apostrophe is not the same as the one in the database.

so the string in the database = schema’s
and the string extracted from the document = schema’s but the apostrophe is just a little bit different

I hope someone knows how to fix this.


Please ZIP and attach your input Word document and text from MySQL (in notepad file) here for testing. We will investigate the issue and provide you more information on it.

on page 9 of the word document in the ZIP you will find the heading i am trying to check for(schema’s).
this does work with all the other headings but not this one.

when i extracted the heading:“schema’s” from the word document into a richTextbox and copied “schema’s” from the database under there into the
same richTextbox i could see there is a small difference in the apostrophe character.

i hope you can work with the information i have given.

apostrophe.zip (703.7 KB)


Please check the following text. In the Word document, the apostrophe character looks as shown below:


The Node.ToString(SaveFormat.Text) method extracts the text correctly. Please check the attached image.
apostrophe.png (15.3 KB)

If you are comparing text in MySQL query, please use two single quotes. Please read
How to escape apostrophe (’) in MySQL?

If you are comparing apostrophe and single quote, you can use String.Replace method to replace them with each other.
apostrophe and single quote.png (1.5 KB)

Moreover, the .NET API returns true for these characters when compare them.

Console.WriteLine("’ and '" == "’ and '");
Console.WriteLine("’ and '".Equals("’ and '"));