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

Free Support Forum - aspose.com

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 “œ”

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>PL</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
<w:UseFELayout/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:Standardowy; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0cm; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>

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.

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.