Page 1 of 1

Possible to determine content-length from output text?

Posted: Mon Mar 10, 2008 1:49 pm
by Jhorra
I have a file that outputs a session value. I need to set the content-length header, but I'm not sure how to determine content-length based solely on the output of that text. Is this possible?

Re: Possible to determine content-length from output text?

Posted: Mon Mar 10, 2008 1:59 pm
by alex.barylski
strlen???

Re: Possible to determine content-length from output text?

Posted: Mon Mar 10, 2008 2:06 pm
by Jhorra
I tried strlen, and it output something like 50000, but when I save that text to a text file and save it to my desktop it says it's 16kb. Is that correct?

Re: Possible to determine content-length from output text?

Posted: Mon Mar 10, 2008 2:12 pm
by alex.barylski
That doesn't sound right, no. Are you working with multibyte languages?