I would like to get the same result for both platforms

The right answer to your question (if there is one) really depends on why you want to get the same result on both platforms?

If, for instance, you hope to use the information as the mechanism for some sort of comparison metric of two files on different systems, then counting chars is fundementally the wrong way to do it.

The only halfway legitimate reason I can think of for wanting to do this, is if your wanting to report the size before and after transfer from one system type to the other, in which case chomping the lines and totaling the line length would probably work.

However, even for this purpose there are better methods of verifying transfers than just counting bytes as this won't detect corruptions of bytes on route.

A little more information may get you a better answer.


Examine what is said, not who speaks.


In reply to Re: char count windows vs linux by BrowserUk
in thread char count windows vs linux by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.