[cvsnt] Problems with text/binary *.rtf files

Gerhard Fiedler lists at connectionbrazil.com
Tue Sep 26 14:09:35 BST 2006


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Thomas Muller wrote:

>| On 9/25/06, Thomas Muller <ttm at online.no> wrote:
>|>|> I have some problems with *.rtf files - when I add them as text they
>|>|> become corrupt - MS Word fails to read the files. If I try to force
>|>|> them into CVS as binary (-kb), they are still showing up as encoding
>|>|> 'text' and MS Word still can't read them.
>|  
>|  What do you mean by "force them into cvs"?
> 
> I mean check-in with format set to binary. This used to work fine for rtf
> files, but not anymore. 

This is not clear in cvs terminology. Typically, you set the -kb option
with either the cvs add command or with the cvs update command, followed by
a cvs commit command. There is no cvs checkin command.

> No idea, mate, - I've never read the RTF spec. Nevertheless; doesn't CVS
> have a switch for unicode formatted documents? Do you think this will do the
> trick? 

Don't use the Unicode switch with RTFs. If you have a look at the spec, it
clearly states that RTFs are ANSI encoded. If you add them to cvsnt with
the -ku switch, they will be utf-16 encoded on checkout -- which is /not/
compatible with RTF. (Even though maybe some RTF readers can deal with
that... I don't know. But in any case, the \uN Unicode characters in the
RTF won't get transformed to utf-16 encoding anyway.)


I think you should get to the ground of what is being corrupted in your
files. Try this:

1- Create a file as usual.
2- Save it and close Word (or the application you used to create it).
3- Make a local copy of it.
4- Open the copy, just to make sure you can do that, without changing
anything.
5- Close the application you used to open the file, and verify that it is
still the same by comparing it with the original from step 2.
6- Add the original from step 2 as text file to cvs, as usual.
7- Commit the addition.

At this point, you said that the file you committed is corrupted. 

8- Compare the committed file from step 7 with the copy from step 3. If
there are any differences, post them here if you can't make sense of them.
9- If no differences, try to open the committed file from step 7. If it
does open, then we have a problem :)
10- If it doesn't open, try to open the copy from step 3. If it also
doesn't open, there seems to be something wrong with your app (given that
the same file opened fine in step 4). If it does open, it wasn't really an
identical copy, it seems, and you need to check the comparison tool you
used in step 8 -- or again your app.


Neither adding as text file with expansion (-kv) nor as binary file (-kb)
should corrupt a RTF (if no merging happened). If it gets corrupted, it is
probably something else.


[FWIW, adding an RTF as binary may make sense given that it's usually not
really mergeable, even though it is text. -kb also prevents merges. But
that's not really your problem.]

Gerhard


More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook