Skip to content

Instantly share code, notes, and snippets.

@donthorp
Created April 28, 2011 18:58
Show Gist options
  • Save donthorp/947039 to your computer and use it in GitHub Desktop.
Save donthorp/947039 to your computer and use it in GitHub Desktop.
Codec String Examples
//Encode and trim a simple UTF-8 String
var buffer = Ti.createBuffer({ length: 1024 });
var length = Ti.Codec.encodeString({
source: "hello world",
dest: buffer
});
buffer.length = length;
//Decode a simple UTF-8 String
var string = Ti.Codec.decodeString({ source: buffer });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment