Skip to content

Instantly share code, notes, and snippets.

@donthorp
Created April 28, 2011 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donthorp/947048 to your computer and use it in GitHub Desktop.
Save donthorp/947048 to your computer and use it in GitHub Desktop.
Buffer Creation With Conversion
// 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" });
// 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