ZF-9195: Numerous files contain ASCII 0x0d (CR) characters
Description
Files that contain embedded ASCII 0x0d characters in them can cause some subversion clients to abort with the fatal error message
"Inconsistent line ending style"
The following script identifies files that have ASCII 0x0d's in them:
!/bin/sh
for i in \ demos/Zend/Pdf/test.pdf \ tests/Zend/Http/_files/response_crlf \ tests/Zend/Http/_files/response_multibyte_body \ tests/Zend/Http/_files/response_chunked_case \ tests/Zend/Http/_files/response_leadingws \ tests/Zend/Http/_files/response_chunked \ library/Zend/Service/DeveloperGarden/Wsdl/ccsPort.xsd \ library/Zend/Http/Client.php \ documentation/manual/tr/ref/language-snippets.xml \ documentation/manual/he/ref/requirements.xml \ documentation/manual/he/ref/language-snippets.xml \ documentation/manual/he/module_specs/Zend_View-Helpers-Doctype.xml \ documentation/manual/bg/ref/language-snippets.xml \ documentation/manual/sr/ref/language-snippets.xml \ documentation/manual/nl/ref/language-snippets.xml \ documentation/manual/sk/ref/language-snippets.xml \ documentation/manual/sk/module_specs/Zend_Controller-ActionHelpers-FlashMessenger.xml \ documentation/manual/ja/module_specs/Zend_Search_Lucene-Queries.xml \ documentation/manual/ko/ref/language-snippets.xml \ documentation/manual/de/ref/language-snippets.xml \ documentation/manual/pl/ref/language-snippets.xml \ documentation/manual/cs/ref/language-snippets.xml \ documentation/manual/it/ref/language-snippets.xml \ documentation/manual/uk/ref/language-snippets.xml \ documentation/manual/id/ref/language-snippets.xml \ documentation/manual/ro/ref/language-snippets.xml \ documentation/manual/ru/ref/language-snippets.xml \ documentation/manual/zh/ref/language-snippets.xml \ documentation/manual/zh/module_specs/Zend_Dojo-View-Dojo.xml \ documentation/manual/sl/ref/language-snippets.xml \ documentation/manual/fa/ref/language-snippets.xml \ documentation/manual/hu/ref/language-snippets.xml \ documentation/manual/hu/module_specs/Zend_Controller-QuickStart.xml \ documentation/manual/ar/ref/language-snippets.xml \ externals/dojo/util/resources/logo/positive/dojox.logo.eps \ externals/dojo/util/resources/logo/positive/dojo.logo.eps \ externals/dojo/util/resources/logo/positive/dijit.logo.eps \ externals/dojo/util/resources/logo/negative/dojox.logo.neg.eps \ externals/dojo/util/resources/logo/negative/dojo.logo.neg.eps \ externals/dojo/util/resources/logo/negative/dijit.logo.neg.eps do echo ----------------------------------------------------------------------- echo $i: od -a $i | egrep '\bcr\b' | head -n 1 od -t x1 $i | egrep '\b0d\b' | head -n 1 done
And here is the output:
demos/Zend/Pdf/test.pdf: 0001060 f cr nl 0 sp 8 cr nl 0 0 0 0 0 0 0 0
0001060 66 0d 0a 30 20 38 0d 0a 30 30 30 30 30 30 30 30
tests/Zend/Http/_files/response_crlf: 0000000 H T T P / 1 . 0 sp 2 0 0 sp O K cr
0000000 48 54 54 50 2f 31 2e 30 20 32 30 30 20 4f 4b 0d
tests/Zend/Http/_files/response_multibyte_body: 0000340 8 nl nl 2 e d cr nl W dle W rs W dle sp W
0000340 38 0a 0a 32 65 64 0d 0a d7 90 d7 9e d7 90 20 d7
tests/Zend/Http/_files/response_chunked_case: 0000000 H T T P / 1 . 1 sp 2 0 0 sp O K cr
0000000 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d
tests/Zend/Http/_files/response_leadingws: 0000000 H T T P / 1 . 1 sp 2 0 0 sp O K cr
0000000 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d
tests/Zend/Http/_files/response_chunked: 0000000 H T T P / 1 . 1 sp 2 0 0 sp O K cr
0000000 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d
library/Zend/Service/DeveloperGarden/Wsdl/ccsPort.xsd: 0004160 cr nl ht < x s d : c o m p l e x T
0004160 0d 0a 09 3c 78 73 64 3a 63 6f 6d 70 6c 65 78 54
library/Zend/Http/Client.php: 0004040 E C T ' ; cr nl sp sp sp sp c o n s t
0004040 45 43 54 27 3b 0d 0a 20 20 20 20 63 6f 6e 73 74
documentation/manual/tr/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/he/ref/requirements.xml: 0770060 cr nl 1 Z e n d _ D b cr nl 1 Z e n
0770060 0d 0a 31 5a 65 6e 64 5f 44 62 0d 0a 31 5a 65 6e
documentation/manual/he/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/he/module_specs/Zend_View-Helpers-Doctype.xml: 0001360 s t i t e m > cr nl sp sp sp sp sp sp sp
0001360 73 74 69 74 65 6d 3e 0d 0a 20 20 20 20 20 20 20
documentation/manual/bg/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/sr/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/nl/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/sk/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/sk/module_specs/Zend_Controller-ActionHelpers-FlashMessenger.xml: 0000060 s s e n g e r " > cr nl sp sp sp sp <
0000060 73 73 65 6e 67 65 72 22 3e 0d 0a 20 20 20 20 3c
documentation/manual/ja/module_specs/Zend_Search_Lucene-Queries.xml: 0000500 soh dc3 c soh ( c stx stx c soh ' c soh cr c soh
0017520 61 6d 6c 69 73 74 69 6e 67 3e 0a 0d 0a 20 20 20
documentation/manual/ko/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/de/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl < ! - - sp E N -
0000040 66 2d 38 22 3f 3e 0d 0a 3c 21 2d 2d 20 45 4e 2d
documentation/manual/pl/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/cs/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/it/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/uk/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/id/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/ro/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/ru/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/zh/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/zh/module_specs/Zend_Dojo-View-Dojo.xml: 0001260 f ht vt e . rs g so 0 f can / e cr sp d
0037000 6f 64 65 3e 3a 0d 0a 20 20 20 20 20 20 20 20 20
documentation/manual/sl/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/fa/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/hu/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
documentation/manual/hu/module_specs/Zend_Controller-QuickStart.xml: 0004100 o n / cr nl sp sp sp sp c o n t r o l
0004100 6f 6e 2f 0d 0a 20 20 20 20 63 6f 6e 74 72 6f 6c
documentation/manual/ar/ref/language-snippets.xml: 0000040 f - 8 " ? > cr nl nl < ! - - sp l i
0000040 66 2d 38 22 3f 3e 0d 0a 0a 3c 21 2d 2d 20 6c 69
externals/dojo/util/resources/logo/positive/dojox.logo.eps: 0000600 cr % A I 9 _ P r i n t i n g D a
0000600 0d 25 41 49 39 5f 50 72 69 6e 74 69 6e 67 44 61
externals/dojo/util/resources/logo/positive/dojo.logo.eps: 0000020 P S F - 3 . 0 cr % A D O _ D S C
0000020 50 53 46 2d 33 2e 30 0d 25 41 44 4f 5f 44 53 43
externals/dojo/util/resources/logo/positive/dijit.logo.eps: 0000560 V e r s i o n : sp 1 3 . 0 . 0 cr
0000560 56 65 72 73 69 6f 6e 3a 20 31 33 2e 30 2e 30 0d
externals/dojo/util/resources/logo/negative/dojox.logo.neg.eps: 0000600 . 0 . 0 cr % A I 9 _ P r i n t i
0000600 2e 30 2e 30 0d 25 41 49 39 5f 50 72 69 6e 74 69
externals/dojo/util/resources/logo/negative/dojo.logo.neg.eps: 0000020 P S F - 3 . 0 cr % A D O _ D S C
0000020 50 53 46 2d 33 2e 30 0d 25 41 44 4f 5f 44 53 43
externals/dojo/util/resources/logo/negative/dijit.logo.neg.eps: 0000560 V e r s i o n : sp 1 3 . 0 . 0 cr 0000560 56 65 72 73 69 6f 6e 3a 20 31 33 2e 30 2e 30 0d
Obviously, these files
demos/Zend/Pdf/test.pdf tests/Zend/Http/_files/response_crlf tests/Zend/Http/_files/response_multibyte_body tests/Zend/Http/_files/response_chunked_case tests/Zend/Http/_files/response_leadingws tests/Zend/Http/_files/response_chunked
should probably not be changed, but the remaining files should be converted to Unix format, to minimize the above mentioned "Inconsistent line ending style" issue.
The easiest way to fix this issue is to run the dos2unix command on these files. Please note that dos2unix may need to be run multiple times.
Thanks!
Comments
Posted by Thomas Weidner (thomas) on 2010-03-15T11:18:30.000+0000
Closing as fixed
All other files are not needed to be changed (PDF file, XSD file, Dojo files...)
Posted by Ross Smith (rasa7777) on 2011-03-30T00:03:37.000+0000
This is still an issue. For example:
$ svn export http://framework.zend.com/svn/framework/… $ cd release-1.11.4 $ svn import . http://example.com/svn/zend/release-1.11.4 ... Adding library/Zend/Service/DeveloperGarden/Wsdl/IPLocation.wsdl Adding library/Zend/Service/DeveloperGarden/Wsdl/TokenService.wsdl Adding library/Zend/Service/DeveloperGarden/Wsdl/ccsPort.xsd svn: Inconsistent line ending style $