Bug 13007

Summary: svn-create-patch doesn't handle UTF files with BOMs as text
Product: WebKit Reporter: Andrew Wellington <andrew>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, ddkilzer
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch darin: review+

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.