Re: [fossil-users] Fossil enhancement idea. Was: trouble handling text files from SQL Server 2012

2012-09-15 Thread Scott Robison
On Fri, Sep 14, 2012 at 11:34 PM, Csaba Kos csaba@gmail.com wrote:

 I am a fossil novice myself, but I don't think there is such
 functionality built-in currently.


I was talking about tagging encoding as well as end of line handling, but
mainly I was giving myself an out in case I was speaking in favor of
something that already exists. :)


 My plan for the EOL conversion was to extend the syntax of the
 crnl-glob setting in the following way:
 *.txt:cr force CR
 *.txt:nl force NL
 *.txt:cr+nlforce CR+NL
 *.txt:native   convert to native format
 anything else:  allow CR+NL (current behaviour)

 But I agree that properties attached to files (similarly to
 subversion, perhaps) might be preferable for setting the encoding/line
 ending.


 That was my thought as well.

SDR
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Fossil enhancement idea. Was: trouble handling text files from SQL Server 2012

2012-09-15 Thread Michal Suchanek
On 15 September 2012 04:20, Csaba Kos csaba@gmail.com wrote:

 I think now would be a good time to discuss the possibility of a more generic
 text conversion framework, i.e. not only UTF16 to UTF8 but also SHIFT-JIS
 to UTF8, and so on. Also CR+NL to NL conversion could be handled by such
 framework as well. One possibility is to support calling of an external 
 command
 which could be specified in some ...-glob setting.


This is not such a good idea. Converting well-formed UTF-16 into UTF-8
is lossless and fully reversible so even in the case some random
binary file is mis-detected as UTF-16 text it is not clobbered by the
conversion given well-formedness is a requirement for it to be
detected so. As long as the resulting object is properly marked as
converted or the conversion is only used for generating diffs, not
storing the file this is fine.

SJIS conversion and CR/LF conversion do not behave that way.

CR/LF conversions are very useful for projects spanning multiple
platforms, though.

Thanks

Michal
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Fossil enhancement idea. Was: trouble handling text files from SQL Server 2012

2012-09-15 Thread Csaba Kos
On Sat, Sep 15, 2012 at 6:00 PM, Michal Suchanek hramr...@gmail.com wrote:
 On 15 September 2012 04:20, Csaba Kos csaba@gmail.com wrote:

 I think now would be a good time to discuss the possibility of a more generic
 text conversion framework, i.e. not only UTF16 to UTF8 but also SHIFT-JIS
 to UTF8, and so on. Also CR+NL to NL conversion could be handled by such
 framework as well. One possibility is to support calling of an external 
 command
 which could be specified in some ...-glob setting.


 This is not such a good idea. Converting well-formed UTF-16 into UTF-8
 is lossless and fully reversible [...]
 SJIS conversion and CR/LF conversion do not behave that way.

Such conversions would have to be requested by the user explicitly (by
setting some property), and if some conversion problem occurs (for
example the file has mixed line endings), we can simply error out or
warn the user.

I agree that more generic conversions can be troublesome to implement
safely and neatly, but at least the EOL conversion is a must have
feature IMHO.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users