Download it now!
Bug 61901 - FILESAVE: Problem with RTF saving
Summary: FILESAVE: Problem with RTF saving
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: Other Windows (All)
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: BSA target:5.3.0 target:5.2.1
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-06 11:55 UTC by Luca Garagnani
Modified: 2016-10-25 18:38 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Before and after (17.40 KB, image/jpeg)
2015-09-14 11:01 UTC, Xisco Faulí
Details
the file (249 bytes, application/msword)
2015-09-14 11:01 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Garagnani 2013-03-06 11:55:52 UTC
Problem description: 
If you open an RTF file with Writer and save it without modifying, it is no longer compatible with some RTF readers.

Steps to reproduce:
1. Create an RTF file like this

{\rtf1\ansi\deff11
{\fonttbl
{\f11\fmodern\fcharset0 Courier New;}
{\f34\fmodern\fcharset204 Courier New Cyr;}
}
{\f11 [ita,rus\par}
{\f11 POTENZA\par}
{\f34 \'c8\'c7\'cc\'c5\'cd\'c5\'cd\'cd\'ce\'c5\'20\'c7\'cd\'c0\'d7\'c5\'cd\'c8\'c5\par}
}

2. Open it with Writer and, without modifying it,  save it with another name. 

3. If you open the RTF file with a text editor you'll see that all fonts charsets are wrong. Also the hexadecimal coding of the cyrillic phrase is wrong (whereas the unicode is right). It seems that the first digit is always 1 while the second digit is correct.

Current behavior:

The resulting RTF is no longer compatible with other programs that read RTF.

Expected behavior:

The resulting RTF should continue to have the right charset for all fonts and the right hex coding for all phrases.

              
Thanks.

Luca
Operating System: Windows 7
Version: 4.0.0.3 release
Comment 1 A (Andy) 2013-04-13 20:27:26 UTC
reproducible with LO 4.0.2.2 (Win7 Home, 64bit)

Result after saving it with LO:
- Different paragraph spacing
- Russian text is in Calibri instead of Courier New
Comment 2 Urmas 2013-04-14 08:48:55 UTC
{\f5\froman\fprq0\fcharset1 Courier New;}{\f6\froman\fprq0\fcharset1 Courier New Cyr;}{\f9\fswiss\fprq0\fcharset1 Tahoma;}

I reported similar bugs #46633, #57464 with similar "charset 1" fonts appearing in generated RTF and corrupted ANSI text.
Comment 3 A (Andy) 2015-02-26 21:21:25 UTC
Reproducible with LO 4.4.1.2, Win 8.1
Comment 4 Xisco Faulí 2015-09-14 11:01:22 UTC
Created attachment 118695 [details]
Before and after

This issue is still present in

Version: 5.0.1.2
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: es-ES (es_ES)

on Windows 7 (64-bit)
Comment 5 Xisco Faulí 2015-09-14 11:01:48 UTC
Created attachment 118696 [details]
the file
Comment 6 Miklos Vajna 2016-07-15 21:04:18 UTC
I see the problem that the 3rd line has a changing font, at least in Word the font name is Courier New, and after LO open + save, it becomes Liberation Serif. I'll look at that.
Comment 7 Commit Notification 2016-07-19 07:37:15 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=43e049c32302620bbc134732286529496853d78a

tdf#61901 RTF export: fix implicit font name of non-ascii text

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2016-07-21 15:53:26 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=181ead2326ea9359cd0077d7f3d955df1140d019&h=libreoffice-5-2

tdf#61901 RTF export: fix implicit font name of non-ascii text

It will be available in 5.2.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.