Converting rtf format to word can't handle with special characters

Hi,

We are using Apsoe.Words version 11.7 to convert rtf document to word,

and when the rtf contains special character such as “19 mm³” (power 3 ~ ^3),

The ³ character is
being replaced by à ³.

But when I’m opening the RTF document using Microsoft Word the character display as expected.

I also tried to perform the conversion using Apsoe.Words version 13.2 and I’m getting the same results.

The following trying to explain the flow:

  1. I’m having RTF file that uses as template (attachment “Template.rtf”) and has space holders to replace with header and body and etc.

  2. I’m replacing the “<<v_report_text>>” space holder at the template file with some text (attachment “text.txt”)
    IMPORTANT NOTE: I’m performing 1 and 2 steps using Oracle sql on CLOB columns so I’m treating those files (Template.rtf and text.txt) as simple strings.

  3. I’m saving the joined rtf file into new CLOB column (i.e. contains Template.rtf and text.txt united).

  4. Converting the rtf file from section #3 from the clob column to word using Aspose and the word document replace the ³ character by à ³.

If I saving the rtf from the CLOB and opening the file using Microsoft Word the characters are displays as expected.

The following link clarifies the special characters and how do we need to treat them:
http://my.safaribooksonline.com/book/programming/microsoft-office/9781449302047/reference-tables/ascii-rtf_character_chart

We can see that ASCII code #179 refer to ³ and his RTF escape character is 'b3.

I’ll appreciate any kind of help or advice.

thanks in advance.

Hi Almog,

Thanks for your inquiry.

I have tested the scenario and have not found the shared issue while using latest version of Aspose.Words for .NET. Please upgrade to the latest version of Aspose.Words v 13.6.0 from here:

https://downloads.aspose.com/words/net

I have used the Encoding.Default to read text from text.txt. Please let us know if you have any more queries.

File.ReadAllText(MyDir + "in.txt", Encoding.Default)