CR-LF translated as CR-CR-LF #717

jonovos opened this Issue Apr 12, 2012 · 1 comment

2 participants


Randomly there seems to be an unwanted translation of end-of-line termination characters. This is a left-over from the *nix & windows ways of doing things. In the microsoft world, lines are terminated with the character pair "Carriage-Return-(\r)" + "Line-Feed-(\n)", otherwise known as "CR-LF", or Hex: 0d-0a, or "\r\n". --Issue: I have noticed that whenever I edit a file which already contains these windows-styled line-terminations (\r\n), the ACE Editor will translate these files into double-carriage-return + line-feed, or "CR-CR-LF", or Hex: 0d-0d-0a, or "\r\r\n". This is incorrect. Instead, every two-character instance of CR-LF should be replaced with the *nix LF. There should never be a sequence of CR-CR. (This confuses Notepad++, Notepad, and other editors in Windows.)

@nightwing B.V. member

Hi, sorry no one responded to this for so long.

ace allows new line character to be \n \r\n or \r based on entered text
and splits text with /\r\n|\r|\n/
sp there shouldn't be a way for it to have value of \r\r\n

ace.setValue("\r\r\n");JSON.stringify(ace.getValue())// == \r\n
ace.setValue("\r\n\r\n");JSON.stringify(ace.getValue())// == \r\n\r\n
ace.setValue("\n\r\n\r");JSON.stringify(ace.getValue())// == \n\n\n

please comment if you have some information on how to reproduce this

closing as insufficent info, for now

@nightwing nightwing closed this Jul 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment