title: Extract UTF-uncoded binary data from JSON using jq
body: <p>Say I have a JSON with a 0xb7 byte encoded as a UTF codepoint:</p>
  
  <pre><code>{"key":"_\u00b7_"}
  </code></pre>
  
  <p>If I extract the value of the "key" with jq it keeps the utf8 encoding of this byte which is "c2 b7":</p>
  
  <pre><code>$ echo '{"key":"_\u00b7_"}' | ./jq '.key' -r | xxd
  0000000: 5fc2 b75f 0a                             _.._.
  </code></pre>
  
  <p><strong>Is there any jq command that extracts the decoded "5f b7 5f" byte sequence out of this JSON?</strong></p>
  
  <p>I can solve this with extra tools like iconv but it's a bit ugly:</p>
  
  <pre><code>$ echo '{"key":"_\u00b7_"}' | ./jq '.key' -r \
        | iconv -f utf8 -t utf32le \
        | xxd -ps | sed -e 's/000000//g' | xxd -ps -r \
        | xxd
  0000000: 5fb7 5f0a                                _._.
  </code></pre>