my strategy on implementing line-endings (eol) support

Alexander Belchenko bialix at ukr.net
Thu Apr 3 19:22:01 BST 2008


Alexander Belchenko пишет:
> According to my example with utf-16 bytestream we never break unicode 
> file content
> when we read it from disk, only when we create new file on disk. So, 
> every time
> we want to write new file content to disk we need to check encoding.

Err, this statement is not correct. Reading utf-16 file in 'rU' mode
will convert all \r to \n. It's incorrect. So I should admit I was wrong
about treating unicode files as text files with arbitrary line-endings.

I don't see any efficient way to handle eol in unicode files without
hurting performance, so it's better to follow hg model and disable
eol-conversion for them, even if user set the 'eol' property to some
value different from 'exact'.




More information about the bazaar mailing list