Bug 13007 - svn-create-patch doesn't handle UTF files with BOMs as text
Summary: svn-create-patch doesn't handle UTF files with BOMs as text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-07 15:05 PST by Andrew Wellington
Modified: 2007-03-09 16:55 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.07 KB, patch)
2007-03-07 15:10 PST, Andrew Wellington
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Wellington 2007-03-07 15:05:43 PST
svn-create-patch gets confused at strings files because diff isn't treating the files as text (it sees the BOM in the UTF-16 file)

Patch to be attached forces all files that svn-create-patch thinks are text to be treated as text.
Comment 1 Andrew Wellington 2007-03-07 15:10:39 PST
Created attachment 13534 [details]
Patch

Trivial patch
Comment 2 David Kilzer (:ddkilzer) 2007-03-07 16:40:11 PST
If you create the patch with this change to svn-create-patch, run svn-unapply, then svn-apply, do you end up with the same changes once you're done?  I'm wondering if there would be any text conversion funny-business where one two-byte UTF-16 character would get split into two one-byte UTF-8 characters in the process.

Comment 3 Andrew Wellington 2007-03-07 17:08:23 PST
In my testing it appears to work correctly in the situation David described.

I just tried adding a line of Japanese text to a file, checking md5 of the file, creating a patch, svn-unapply, svn-apply, checking the md5 of the file. At both points the md5 was identical.
Comment 4 Darin Adler 2007-03-07 17:24:22 PST
Comment on attachment 13534 [details]
Patch

Can svn-apply and svn-unapply handle these kind of diffs?

If not, we need to fix those first.
Comment 5 Darin Adler 2007-03-08 08:58:32 PST
Comment on attachment 13534 [details]
Patch

r=me
Comment 6 David Kilzer (:ddkilzer) 2007-03-09 16:55:30 PST
Committed revision 20095.