title: How to convert string to ECS/P Hex
body: <p>I'm using jquery / javascript to print raw data to a network label printer. In order to do that the strings will need to be converted to hexadecimal. with a <code>\x</code> preceding each character.</p>
  
  <p>SO if I wanted to print a label with "<strong>I love stackoverflow</strong>" the string would need to be converted to <code>\x49\x20\x6C\x6F\x76\x65\x20\x73\x74\x61\x63\x6B\x6F\x76\x65\x72\x66\x6C\x6F\x77</code>.</p>
  
  <p>I have searched around and I can't find anything on this. Any ideas on how this can be achieved? </p>
  
  <p>I could create a library of variables for each character <code>var A = '/x41;</code> and then run the string through a 'checker' that goes through the entire sting, but I feel like I am missing a simpler solution. </p>