Buffer unicode
syntax: |
buffer.unicode |
description: |
This property is a boolean flag specifying whether to use unicode strings when calling Buffer getString() and Buffer putString(). This value is set when the buffer is created, but may be changed at any time. This property defaults to the unicode status of the underlying ScriptEase engine.
When the Buffer toString() method is used with a Unicode buffer, an ASCII based string, of type string, is returned.
The size of an Unicode buffer is usually twice the size of an ASCII based, or byte based, buffer. For example,
var b1 = new Buffer("abc"); var b2 = new Buffer("abc", true); Result in the following:
b1.size == 3 b2.size == 6; |
see: |
|
example: |
var b1 = new Buffer("abc", true); // b1.unicode == true; |