Professional Web Applications Themes

break lines - Mac Programming

Apologies if this is the wrong forum: I've just created a CMS that has to recognise line breaks in the user input. Do Apple computers use the same convention as Windows machines, that is output \r\n ?...

  1. #1

    Default break lines

    Apologies if this is the wrong forum: I've just created a CMS that has
    to recognise line breaks in the user input. Do Apple computers use the
    same convention as Windows machines, that is output \r\n ?
    Peter Guest

  2. #2

    Default Re: break lines

    Hi Peter,

    com (Peter Cartwright) writes: 

    No. Classic Mac OS (<= 9) uses carriage-returns only (\r). The
    current version (>= 10) is a Unix, so most applications use line-feeds
    (\n) today.

    But there are of course still a lot of applications written for the
    older systems around, so new applications should accept at both these
    conventions as much as possible. Of course in the brave new world of
    Internet, it's a good idea to support DOS files, too.

    benny
    Benjamin Guest

  3. #3

    Default Re: break lines

    In article <google.com>,
    com (Peter Cartwright) wrote:
     

    Nope. Historically Macs used only CR. Many recent programs prefer LF.
    Some, for compatibility reasons, will do CRLF either optionally or by
    default. As of 1/20/2004, I'd say CR remains dominant but is losing
    ground to LF.

    You could (should, even) make the line detection generic by accepting
    either of those characters as line breaks, with the special case that if
    an LF follows a CR (or vice-versa; I've seen that too) with no
    intervening characters it gets eaten. That lets you dealing with any
    platform, or even mixed conventions within a single stream.

    G
    Gregory Guest

Similar Threads

  1. Vertical lines in AI graphics PDF as broken lines?
    By SuperMacGuy@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: September 11th, 08:30 PM
  2. Break a single line info in a column of a datagrid into Two lines
    By Alvin Bruney [MVP] in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: August 28th, 08:01 PM
  3. Acrobat 6 changes solid lines to dashed lines
    By Connie_Nathanson@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 22nd, 02:52 PM
  4. read lines of file without parsing the lines
    By W. Paulisse in forum PHP Development
    Replies: 3
    Last Post: February 11th, 01:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139