| Platform | Since |
|---|---|
| Android | 1.7 |
| iPhone | 1.7 |
| iPad | 1.7 |
Encodes the String source into dest using charset.
Throws an Exception if charset is not a valid character set,
source is null, or either sourcePosition, sourceLength, or
sourcePosition+sourceLength is greater than source.length.
var buffer = Ti.createBuffer({ length: 1024 }); var length = Ti.Codec.encodeString({ source: "hello world", dest: buffer }); buffer.length = length;
// (10 * 2) + BOM = 22 var buffer = Ti.createBuffer({ length: 22 }); Ti.Codec.encodeString({ source: "jack jumped over the candle stick", sourceLength: 10, dest: buffer, charset: Ti.Codec.CHARSET_UTF16 });
| Name | Type | Summary |
|---|---|---|
| options | Dictionary<EncodeStringDict> |
encodeString named options |