Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UnicodeEncoding encoding = new UnicodeEncoding();
- byte[] bytes = encoding.GetBytes(AnyString);
- var str = "Hello";
- var bytes = [];
- for (var i = 0; i < str.length; ++i)
- {
- bytes.push(str.charCodeAt(i));
- }
- alert(bytes); // 72,0,101,0,108,0,108,0,111,0
Add Comment
Please, Sign In to add comment