Perhaps you are looking for following code.....try { var str="string I
need to convert"; //xfa.host.messageBox(""+stringToBytes(str)); var
bytArray = stringToBytes(str).split(",");} catch (e) {
xfa.host.messageBox(""+e)}function stringToBytes(str) { var ch, st, re =
[]; for (var i = 0; i < str.length; i++ ) { ch = str.charCodeAt(i); //
get char st = []; // set up "stack" do { st.push( ch & 0xFF ); // push
byte to stack ch = ch >> 8; // shift value down by 1 byte } while ( ch
); // add stack cont...