Created
April 28, 2011 19:01
-
-
Save donthorp/947048 to your computer and use it in GitHub Desktop.
Buffer Creation With Conversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a buffer and encode a string at the same time. | |
// Using default encoding of Ti.Codec.CHARSET_UTF8 | |
var buffer = Ti.createBuffer({ value: "Hello World" }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a buffer and encode a string to UTF16 | |
var buffer = Ti.createBuffer({ | |
value: "Hello World", | |
type: Ti.Codec.CHARSET_UTF16 | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment