string.length to bytes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim

    #1

    string.length to bytes

    Hi,
    What is the ratio between the number of characters in a file and its
    filesize? I have a HTML-document with all tags and such written out in a
    textarea and document.forms. myForm.elements .myTextarea.val ue.length
    is 5500 or so, and I want to predict how many the number of bytes it is
    going to be once saved. Some tests gave me different results so I am
    clueless.
    Thanks,
    Tim.





  • Bert

    #2
    Re: string.length to bytes


    "Tim" <spamless@thank .god> schreef in bericht
    news:421e84d8$0 $29193$afc38c87 @news.wanadoo.n l...[color=blue]
    > Hi,
    > What is the ratio between the number of characters in a file and its
    > filesize? I have a HTML-document with all tags and such written out in a
    > textarea and document.forms. myForm.elements .myTextarea.val ue.length
    > is 5500 or so, and I want to predict how many the number of bytes it is
    > going to be once saved. Some tests gave me different results so I am
    > clueless.
    > Thanks,
    > Tim.
    >
    >
    >
    >
    >[/color]

    Did you make a graph of it? plotting number of elements against file size,
    I would simply draw a line fitting the points as good as possible
    and make that line your prediction, unless off course the points are
    behaving very non lineair, but I cannot imagine that.

    grt Bert


    Comment

    Working...