You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Sean McBride <se...@rogue-research.com> on 2006/07/13 17:39:40 UTC

'svn add' succeeds but errors out because file 'has binary mime type property'

Hi all,

I have a folder I wish to add to my working copy, so I use 'svn add'. 
It starts recursively adding the files, but then hits one and stops,
complaining:

svn: File 'Installer.app/Contents/Resources/English.lproj/
InfoPlist.strings' has binary mime type property

then stops and doesn't add the other files in the folder.  Yet it _did_
add the file it complained about:

A      Installer.app/Contents/Resources/English.lproj/InfoPlist.strings

What is that message supposed to be telling me?  It's not very clear at all.

In my auto-props I have:

*.strings = svn:eol-style=LF

.strings files are UTF-16, perhaps svn is not detecting them as text,
and thus confused that I want to set the eol style of a binary file? 
Doesn't specifying an 'eol-style' give svn a hint that's it's not binary?! :)

I'd like to suggest the following to the developers:
1) that error message should be a warning, seeing as it added the file anyway
2) that error message should go away entirely, since having an 'eol-
style' property implies text
3) utf16 files should be autodetected as text, not binary

Anyone know if bugs exist for this already?

Thanks,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean@rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: 'svn add' succeeds but errors out because file 'has binary mime type property'

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 13, 2006, at 19:39, Sean McBride wrote:

> svn: File 'Installer.app/Contents/Resources/English.lproj/
> InfoPlist.strings' has binary mime type property
>
> then stops and doesn't add the other files in the folder.  Yet it  
> _did_
> add the file it complained about:
>
> A      Installer.app/Contents/Resources/English.lproj/ 
> InfoPlist.strings
>
> What is that message supposed to be telling me?  It's not very  
> clear at all.
>
> In my auto-props I have:
>
> *.strings = svn:eol-style=LF
>
> .strings files are UTF-16, perhaps svn is not detecting them as text,
> and thus confused that I want to set the eol style of a binary file?
> Doesn't specifying an 'eol-style' give svn a hint that's it's not  
> binary?! :)
>
> I'd like to suggest the following to the developers:
> 1) that error message should be a warning, seeing as it added the  
> file anyway
> 2) that error message should go away entirely, since having an 'eol-
> style' property implies text
> 3) utf16 files should be autodetected as text, not binary

Subversion does not handle UTF-16 files as text. It treats them as  
binary. This is the following bug, which I found by searching the  
issue database for "UTF":

http://subversion.tigris.org/issues/show_bug.cgi?id=2194

Mac OS X .strings files appear to have the proper byte-order marker,  
providing an easy (and IMHO the only) means by which Subversion could  
detect the UTF-16-ness of these files. However, Subversion currently  
does not do so.

svn:eol-style transformations can only be done on text files. Thus  
the error message is likely displayed because you've asked for text- 
file transformations to be done to a file that Subversion recognizes  
as binary.

In particular, Subversion seems concerned with the file's assigned  
MIME type within Subversion. You could try giving .strings files an  
svn:mime-type in the text/* space, but you'd have to see whether it  
would know how to do end-of-line conversions on 2-byte characters.  
The fact that bug 2194 isn't resolved leads me to believe it won't work.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: 'svn add' succeeds but errors out because file 'has binary mime type property'

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 14, 2006, at 23:22, Sean McBride wrote:

> On 2006-07-13 14:25, Ted Dennison said:
>
>>> 3) utf16 files should be autodetected as text, not binary
>>
>> I'm not a Subversion dev, but I'm curious how would one go about  
>> doing
>> this? Normal text files can be detected by the fact that no byte  
>> in them
>> is larger than 7F.
>
> That's only true if you're talking about plain ASCII.  Other encodings
> like MacRoman, UTF-8, ISO 8859, use the upper 128 chars for things  
> like
> accented characters, see:
> <http://en.wikipedia.org/wiki/Extended_ASCII>
>
> I don't know, but I figured svn would be looking for patterns of CR/LF
> chars to guess if something is text.  There is no sure-fire way to  
> know
> of course.
>
> UTF-16 could also be detected by the BOM:
> <http://en.wikipedia.org/wiki/Byte_Order_Mark>

I think this is quite relevant:

http://subversion.tigris.org/issues/show_bug.cgi?id=2332

It discusses how Subversion should store the encoding of files either  
within the svn:mime-type property (e.g. svn:mime-type = "text/html;  
charset=utf-16") or in a new svn:encoding property (the latter of  
which sounds better to me). If Subversion did (or allowed) this, then  
svn diff and svn merge and friends could make use of this information  
to properly handle UTF-16 and other encodings. UTF-16 (UTF-32, etc.)  
files with byte-order markers could automatically be assigned the  
correct encoding property, and files without a BOM could still have  
it set manually by the user.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: 'svn add' succeeds but errors out because file 'has binary mime type property'

Posted by Sean McBride <se...@rogue-research.com>.
On 2006-07-13 14:25, Ted Dennison said:

>> 3) utf16 files should be autodetected as text, not binary
>>   
>I'm not a Subversion dev, but I'm curious how would one go about doing 
>this? Normal text files can be detected by the fact that no byte in them 
>is larger than 7F.

That's only true if you're talking about plain ASCII.  Other encodings
like MacRoman, UTF-8, ISO 8859, use the upper 128 chars for things like
accented characters, see:
<http://en.wikipedia.org/wiki/Extended_ASCII>

I don't know, but I figured svn would be looking for patterns of CR/LF
chars to guess if something is text.  There is no sure-fire way to know
of course.

UTF-16 could also be detected by the BOM:
<http://en.wikipedia.org/wiki/Byte_Order_Mark>

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean@rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: 'svn add' succeeds but errors out because file 'has binary mime type property'

Posted by Ted Dennison <de...@ssd.fsi.com>.
Sean McBride wrote:
> 3) utf16 files should be autodetected as text, not binary
>   
I'm not a Subversion dev, but I'm curious how would one go about doing 
this? Normal text files can be detected by the fact that no byte in them 
is larger than 7F. In UTF16, all 16-bit values are possibly valid as 
characters.

-- 
T.E.D.   Work     -  mailto:dennison@ssd.fsi.com
         Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
         Homepage -  http://www.telepath.com/~dennison/Ted/TED.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org