How to get size in Bytes of textarea value [closed]?

The size in bytes of a text snippet depends on the encoding which can be arbitrary (overridden by the user agent). Measuring regular text in bytes makes sense only if the encoding is known. For example, ASCII text is 1 byte per char.

Unicode UTF-16LE has 2 bytes. UTF-8 is a whole different story, things can span from 1 byte to 4 bytes.

Actually, strings in JS are stored in UTF-16 internally. At least, in FF. – kirilloid Feb 7 at 19:42 1 Unicode has 2 bytes - NO.

Unicode is not an encoding. But, good point about the size depending on the encoding. – MДΓΓ БДLL Feb 7 at 19:43 I want to get the size in bytes of ANSI encoding.

– Ron Feb 7 at 19:58 @Ron: The size in bytes of ANSI encoding equals to the number of chars. – Saul Feb 7 at 19:59 @Saul, no it doest because \n should be 2 bytes but the . Length function counts it as one.(\n as new line).

– Ron Feb 7 at 20:01.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions