12

I'm receiving data from an AJAX request, and it's really weird. I thought it was unicode, but unicode's codes are like \u00E7 (ç).

\x3Cb\x3E\x3C

What do you think this is? And how can I convert it to normal text with Java?

tripleee
  • 175,061
  • 34
  • 275
  • 318
Alex
  • 34,581
  • 26
  • 91
  • 135

2 Answers2

14

It might be plain ASCII. \x3Cb\x3E\x3C decodes to <b><.

binaryLV
  • 9,002
  • 2
  • 40
  • 42
  • What are you familiar with? C++, C#, PHP, Python, anything would work. I can't find the solution on the internet. How did you decode it so fast? – Alex Jun 02 '11 at 09:33
  • 3
    I found the solution here: http://stackoverflow.com/questions/3775684/decoding-html-returned-as-json-response-android/3776170#3776170 – Alex Jun 02 '11 at 09:36
  • 2
    I typed `javascript:alert('\x3Cb\x3E\x3C');` in browser's address bar ;) It is a way to escape symbols, "\" is escape character, `x` means that next 2 symbols are char code in HEX, so `\x3C` is `chr(0x3C)` or `chr(60)`, which results in "<" symbol. – binaryLV Jun 02 '11 at 09:36
-1

html entities it is. So you have html content embedded in your ajax hash. what language you are using? there should be several encode/decode anyway. RoR has it for sure, in .NET is use the JSON.NET lib to decode.

YvesR
  • 5,922
  • 6
  • 43
  • 70
  • 2
    it has nothing to do with HTML entities. HTML entities start with `&`, end with `;` and have either name of entity between those chars (e.g., `&` or `'`) or `#` sign after `&`, followed by char code (e.g., `A` or `A` for letter "A"). – binaryLV Jun 02 '11 at 09:34