Convert Text to hex

Hi,
I must convert a text to hex. I wrote this:

var art = 'A';

var arr = ;

arr[0] =art.toString(16);

but the result is always "A".

Is correct this sintax?

thanks

What do you want array[0] to be set to?

the value 41.

"A" convert to hex = 41

You want the character code for the character then.

var art = 'A'
msg.payload  = art.charCodeAt(0)
return msg;

That gives you the numeric character code.

ok thanks