DecoderFallBackException for french characters like 'é'- 'û' etc

Hello,

We are using a licensed version of Aspose.Words DLL Version - 9.2.0.0. We are first converting the Bytes to String using the below piece of code:

str = System.Text.Encoding.Default.GetString(bytes);

We then manipulate with the string and replace certain tags with data values. For Eg. "TagTodaysDate" gets set to "31 août 2015". We then again convert the String to Bytes using the below piece of code:

bytes = System.Text.Encoding.Default.GetBytes(str);

We need to store this text as an attachment hence, we are converting it into Document using the Aspose DLL as per below piece of code:

Stream attachMemStm = new MemoryStream(bytes)

Aspose.Words.Document docAttachment = new Aspose.Words.Document(attachMemStm);

While coverting the memory stream to attachment below exception occurs:

a) DecoderFallBackException - Unable to Translate bytes [C3] at index X from specified code page to Unicode.
b) XMLException - Invalid character in the given encoding

This seems to be due to the character - é which is equivalent to "c3 a9" in UTF8
Suggestions please.Hello,

We are using a licensed version of Aspose.Words DLL Version - 9.2.0.0. We are first converting the Bytes to String using the below piece of code:

str = System.Text.Encoding.Default.GetString(bytes);

We then manipulate with the string and replace certain tags with data values. For Eg. "TagTodaysDate" gets set to "31 août 2015". We then again convert the String to Bytes using the below piece of code:

bytes = System.Text.Encoding.Default.GetBytes(str);

We need to store this text as an attachment hence, we are converting it into Document using the Aspose DLL as per below piece of code:

Stream attachMemStm = new MemoryStream(bytes)

Aspose.Words.Document docAttachment = new Aspose.Words.Document(attachMemStm);

While coverting the memory stream to attachment below exception occurs:

a) DecoderFallBackException - Unable to Translate bytes [C3] at index X from specified code page to Unicode.
b) XMLException - Invalid character in the given encoding

This seems to be due to the character - é which is equivalent to "c3 a9" in UTF8
Suggestions please.

Hello,

We are using a licensed version of Aspose.Words DLL Version - 9.2.0.0. We are first converting the Bytes to String using the below piece of code:

str = System.Text.Encoding.Default.GetString(bytes);

We then manipulate with the string and replace certain tags with data values. For Eg. "TagTodaysDate" gets set to "31 août 2015". We then again convert the String to Bytes using the below piece of code:

bytes = System.Text.Encoding.Default.GetBytes(str);

We need to store this text as an attachment hence, we are converting it into Document using the Aspose DLL as per below piece of code:

Stream attachMemStm = new MemoryStream(bytes)

Aspose.Words.Document docAttachment = new Aspose.Words.Document(attachMemStm);

While coverting the memory stream to attachment below exception occurs:

a) DecoderFallBackException - Unable to Translate bytes [C3] at index X from specified code page to Unicode.
b) XMLException - Invalid character in the given encoding

This seems to be due to the character - é which is equivalent to "c3 a9" in UTF8
Suggestions please.

Hi,


Thanks for your inquiry. First off, you’re using a very old version of Aspose.Words for .NET on your end. We would suggest you please upgrade to the latest version i.e. 15.12.0. Hope, this helps. In case the problem still remains, please attach the following resources here for testing:

  • Your input Word document if any
  • Please create a standalone console application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

Best regards,