News for hackers. Stuff that matters.
Re:UTF-8 – "The most elegant hack" by jameshart on Saturday September 28, 2013 @11:32PM (#6464002)
Even Windows-format ASCII isn't fixed width - CR-LF is a two-byte 'codepoint'...
Re:UTF-8 – "The most elegant hack" by nitrogen on Sunday September 29, 2013 @04:12AM (#6464511)
You can think of it as two separate instructions, CR to move horizontally to the beginning of the line, and LF to move down by one line.
Re:UTF-8 – "The most elegant hack" by jameshart on Monday September 30, 2013 @09:40AM (#6469534)
You can think of it that way until you say, try to take the first n characters of a string and wind up with your string terminated with an orphaned CR without its accompanying LF.

Outside of ANSI terminals, teletypes and and dot matrix printers, they really don't work like that any more. If they did you'd be able to substitute LFCR for CRLF, or use multiple LFs with a single CR to leave multiline gaps - and multiple CRs would be redundant. Try sending a CSV file with LFCR line-endings, or HTTP headers separated by CRCRCRCRLF... see if that works everywhere reliably. Also, CRLF would be an acceptable substitute everywhere for UNIX LF line-endings, but clearly it's not. Fact is, CRLF is a two-byte magic number in a lot of places.

Re:UTF-8 – "The most elegant hack" by zorked on Sunday September 29, 2013 @06:46AM (#6464768)
Not really because a single CR or LF does not do a real CR or LF.
Re:UTF-8 – "The most elegant hack" by prewett on Sunday September 29, 2013 @10:05AM (#6465202)
It used to, back in The Day, when you had hard-copy consoles or even dot matrix printers. I think sending CR (but not LF) and then printing accents over top of the original line was a way of printing some European languages with just ASCII.
Re:UTF-8 – "The most elegant hack" by barrkel on Sunday September 29, 2013 @03:46PM (#6466254)

  $ man terminfo | grep cursor_down | head -1
         cursor_down                   cud1       do        down one line
  $ tput cud1 | hexdump -C | cut -f 1-20 | head -1
  00000000  0a                                                |.|
  $ man terminfo | grep carriage_return | head -1
         carriage_return               cr         cr        carriage return (P*)
  $ tput cr | hexdump -C | cut -f 1-20 | head -1
  00000000  0d                                                |.|
If you ever write a bash script that does more advanced things with the terminal, you'll get familiar with tput, termcap and terminfo pretty quickly.
Re:UTF-8 – "The most elegant hack" by kps on Sunday September 29, 2013 @10:01PM (#6467416)
It does in ASCII, and (consequently) in any ANSI-conforming terminal [emulator].