id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 5318,"csv load fails with \""",Kurt Schwehr,Kurt Schwehr,"Don Hatch figured out the fix here. Given {{{ Description,Attr0,Lon,Lat ""three things"",aaa,bbb,ccc ""three more things"",""ddd"",e""e""e,""""f""""f""""f"""" ""backslashes outside quotes"",\ggg,hhh\,i\ii ""double backslashes outside quotes"",\\jjj,kkk\\,l\\ll ""backslashes inside quotes"",""\mmm"",""nnn\"",""o\oo"" ""double backslashes inside quotes"",""\\ppp"",""qqq\\"",""r\\rr"" ""yet another three things"",sss,ttt,uuu }}} opening the file fails to give the expected results. {{{ got: ['three things', 'aaa', 'bbb', 'ccc'] want: ['three things', 'aaa', 'bbb', 'ccc'] got: ['three more things', 'ddd', 'eee', 'fff'] want: ['three more things', 'ddd', 'eee', 'fff'] got: ['backslashes outside quotes', '\\ggg', 'hhh\\', 'i\\ii'] want: ['backslashes outside quotes', '\\ggg', 'hhh\\', 'i\\ii'] got: ['double backslashes outside quotes', '\\\\jjj', 'kkk\\\\', 'l\\\\ll'] want: ['double backslashes outside quotes', '\\\\jjj', 'kkk\\\\', 'l\\\\ll'] # trouble starts here got: ['backslashes inside quotes', '\\mmm', 'nnn\\', 'o\\oo\ndouble backslashes inside quotes'] want: ['backslashes inside quotes', '\\mmm', 'nnn\\', 'o\\oo'] got: ['yet another three things', 'sss', 'ttt', 'uuu'] want: ['double backslashes inside quotes', '\\\\ppp', 'qqq\\\\', 'r\\\\rr'] }}} Proposed fix - remove this: {{{ && (i == 0 || pszWorkLine[i-1] != '\\') }}} source:trunk/gdal/ogr/ogrsf_frmts/csv/ogrcsvlayer.cpp#L169 will become: {{{ while( TRUE ) { for( ; pszWorkLine[i] != '\0'; i++ ) { if( pszWorkLine[i] == '\""' ) nCount++; } }}}",defect,closed,normal,,default,unspecified,normal,fixed,csv,