RTF to ODT conversion- locale problem

I have problem at conversion from RTF with polish characters to ODT.
Polish chars is not well converted for example:

“ś” after conversion is “œ”

Interestingly problem does not occur in all RTF files
My version of Aspose.Words 15.8.0

Attached example source.rtf and converted file result.odt (zipped)

Hi Witold,

Thanks for your inquiry. We have not found “ś” in your input Rtf document. Could you please share some more detail about your query along with screenshot of problematic text?

Screenshot problematic “ś” in source.rtf opened in Word 2013

Probably problem is in RTF font definition “\fcharset1”
Manual conversion to “\fcharset238” (Windows 1250) resolve problem.
But why Word interprets font definition differently than Aspose.Word ?

Thanx for reply

Warning Callback log:

Export of all Document.DocPr members is not supported for ODT format by Aspose.Words except: DocPr.ShowRevisions, DocPr.DocumentProtection, DocPr.DefaultTabStop, DocPr.AutoHyphenation, DocPr.CompatibilityOptions.
Export of all Document.DocPr.CompatibilityOptions members is not supported for ODT format by Aspose.Words except: DoNotUseHTMLParagraphAutoSpacing, ApplyBreakingRules, NoColumnBalance, NoLeadin.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of shape formatting modifier 0x03b0 is not supported for ODT format by Aspose.Words.
Export of shape formatting modifier 0x101c is not supported for ODT format by Aspose.Words.
Export of shape formatting modifier 0x1023 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of cell formatting modifier 0x0bcc is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of cell formatting modifier 0x0bcc is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of cell formatting modifier 0x0bcc is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of shape formatting modifier 0x03b0 is not supported for ODT format by Aspose.Words.
Export of shape formatting modifier 0x101c is not supported for ODT format by Aspose.Words.
Export of shape formatting modifier 0x1023 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of paragraph formatting modifier 0x04e2 is not supported for ODT format by Aspose.Words.
Export of paragraph formatting modifier 0x04f6 is not supported for ODT format by Aspose.Words.
Export of run formatting modifier 0x00f0 is not supported for ODT format by Aspose.Words.
Export of paragraph formatting modifier 0x04e2 is not supported for ODT format by Aspose.Words.
Export of paragraph formatting modifier 0x04f6 is not supported for ODT format by Aspose.Words.
Export of paragraph formatting modifier 0x04e2 is not supported for ODT format by Aspose.Words.
Export of paragraph formatting modifier 0x04f6 is not supported for ODT format by Aspose.Words.
Export of section formatting modifier 0x0834 is not supported for ODT format by Aspose.Words.
Export of section formatting modifier 0x097e is not supported for ODT format by Aspose.Words.

Hi Witold,

Thanks for your inquiry. Please check the attached screenshot of Word 2013. The shared document does not contain character “ś”. Please make sure that you attached the correct input RTF in this forum thread.

Regarding the warning callback, please share a standalone/runnable simple application (for example a Console Application Project) that demonstrates the code (Aspose.Words code) you used to generate your output document and warning callback. We will then provide you more information about this query.

I verified rtf file - problematic is font definitions in RTF header:

Oryginal font definition:

{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset238 Tahoma;}{\f2\fnil\fcharset1 Times New Roman;}{\f3\fnil\fcharset238 Arial;}{\f4\fnil\fcharset2 Wingdings;}}

Manual corrected RTF - works fine:

{\fonttbl{\f0\fnil\fcharset238 Arial;}{\f1\fnil\fcharset238 Tahoma;}{\f2\fnil\fcharset238 Times New Roman;}{\f3\fnil\fcharset238 Arial;}{\f4\fnil\fcharset2 Wingdings;}}

Attached complete example code with sample files and another screenshot from Word 2013.

Code:

public class AsposeWordsRtfToOdtProblemDemo {

    static class HandleFontSubstitution implements IWarningCallback {
        @Override
        public void warning(WarningInfo info) {
            System.out.println(info.getDescription());
        }
    }

    public static void main(String[] args) {
        try {
            File rtfFile = new File("source.rtf");
            System.out.println(rtfFile.getAbsolutePath());
            HandleFontSubstitution callback = new HandleFontSubstitution();

            LoadOptions lo = new LoadOptions();
            lo.setWarningCallback(callback);
            lo.setEncoding(Charset.forName("cp1250"));
            lo.setLoadFormat(LoadFormat.RTF);
            Document doc = new Document("source.rtf", lo);

            OdtSaveOptions so = new OdtSaveOptions();
            so.setWarningCallback(callback);
            so.setSaveFormat(SaveFormat.ODT);
            doc.save("result.odt", so);
        } catch (Exception ex) {
            Logger.getLogger(AsposeWordsRtfToOdtProblemDemo.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

Hi Witold,

Thanks for sharing the detail. We have modified the font definitions in RTF header and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-12821. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

We suggest you please read supported features while import/export of Odt file format from following links.
Load in the OpenDocument Text (.ODT, .OTT) Format
Save in the OpenDocument Text (.ODT, .OTT) Format

The issues you have found earlier (filed as WORDSNET-12821) have been fixed in this .NET update and this Java update.

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