title: What kind of string uses prefix \x and how to read it
body: <p>I have a string like this </p>
  
  <pre><code>"\x27\x18\xf6,\x03\x12\x8e\xfa\xec\x11\x0dHL"
  </code></pre>
  
  <p>when i put it in browser console, it automatically becomes something else:</p>
  
  <pre><code>"\x27\x18\xf6,\x03\x12\x8e\xfa\xec\x11\x0dHL"
  "'ö,úìHL"
  </code></pre>
  
  <p>if I do <code>chatAt(x)</code> over this string, I get:</p>
  
  <pre><code>"\x27\x18\xf6,\x03\x12\x8e\xfa\xec\x11\x0dHL".charAt(0)
  "'"
  "\x27\x18\xf6,\x03\x12\x8e\xfa\xec\x11\x0dHL".charAt(1)
  ""
  "\x27\x18\xf6,\x03\x12\x8e\xfa\xec\x11\x0dHL".charAt(2)
  "ö"
  </code></pre>
  
  <p>which IS what I want.</p>
  
  <p>Now I want to implement a Java program that reads the string the same way as in browser.</p>
  
  <p>The problem is, Java does not recognize the way this string is encoded. Instead, it treats it as a normal string:</p>
  
  <pre><code>"\\x27\\x18\\xf6,\\x03\\x12\\x8e\\xfa\\xec\\x11\\x0dHL".charAt(0) == '\'
  "\\x27\\x18\\xf6,\\x03\\x12\\x8e\\xfa\\xec\\x11\\x0dHL".charAt(1) == 'x'
  "\\x27\\x18\\xf6,\\x03\\x12\\x8e\\xfa\\xec\\x11\\x0dHL".charAt(2) == '2'
  </code></pre>
  
  <p>What kind of encoding this string is encoded? What kind of encoding uses prefix <code>\x</code>?
  Is there a way to read it properly (get the same result as in browser)?</p>
  
  <p>update: I found a solution -> i guess it is not the best, but it works for me:</p>
  
  <pre><code>StringEscapeUtils.unescapeJava("\\x27\\x18\\xf6,\\x03\\x12\\x8e\\xfa\\xec\\x11\\x0dHL".replace("\\x", "\\u00"))
  </code></pre>
  
  <p>thank you all for your replies :)
  especially Ricardo Cacheira</p>
  
  <p>Thank you</p>