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

Free Support Forum - aspose.com

"PLUS-MINUS SIGN" is not showing right when exporting from Word doc using Aspose.Words

Hi -- I am trying to upload a word file using Aspose.Words. One of the characters in the text is so-called "PLUS-MINUS SIGN" -- ± (unicode character code 00B1). I debugged the code and found out that it is transformed to something else right after I got the text from the Word document to Aspose.Word.Table. Can tou please tell me if there is a way to get this character correctly?

Here is the code I am using to process the file:

public static DataSet LoadFromFile(Stream ioStream, string country, string year, ref ArrayList errorsList, ref string errorMessage)

.

.

.

Aspose.Words.Document doc = new Document(ioStream);

Aspose.Words.Table tbl;

.

.

.

Thanks, Vlad.

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I tried to reproduce this issue but it seems that all works fine on my side.

Could you please attach your document for testing? Note that PLUS-MINUS character could be inserted as Symbol (not Unicode character.).

Best regards.

Thanks, Alexey -- I am attaching a file in question.

Thanks, Vlad.

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. This symbol is inserted as Symbol: 00B1. Try to insert it as Unicode PLUS-MINUS-SIGN. Please see the attached document for example. There are two plus-minus signs, one is Unicode another is Symbol.

Use the following code to read these symbols:

Document doc = new Document(@"Test041\in.doc");

string unicode = doc.FirstSection.Body.FirstParagraph.Runs[0].Text;

string symbol = doc.FirstSection.Body.FirstParagraph.Runs[1].Text;

Best regards.

Alexey -- I cannot "replace" the character -- we process documents that are sent to us.

As for the character -- I think I found a bug in ASPOSE. In the document this character has 0x00B1 code. When it is processed by ASPOSE (I saw it while debugging) it becomes 0xF0B1. After I replace programmatically 0xF0B1 to 0x00B1 on the fly I was able to see PLUS-MINUS sign on the page.

Thanks, Vlad.

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

It is not a bug. Aspose.Words reads text from the document in UTF-8 encoding. If character is valid Unicode character then it is exported to TXT correctly. As an additional test you can just copy PLUS-MINUS character form your document and paste into TXT document, you will see that it is inserted as square. (You can also try save your document as TXT document using MS Word)

Also PLUS-MINUS character is displayed correctly after converting to any format supported by Aspose.Words, except TXT.

Best regards.