A few months ago, I came across this blog post when I decided to switch from Firefox to Chrome. I've decided to switch back to Firefox and I'm now in the process of trying to convert the data from the SQLite database into a JSON file. I haven't gotten this working yet mostly because the SQLite database is storing column data as UTF-16LE data in hex, but I'm making progress. I'm going to use this blog post to document some of the progress I make so I don't have to relearn/rewrite commands I've already come up with.

function hex2string () {
  I=0
  while [ $I -lt ${#1} ];
  do
    echo -en "\x"${1:$I:2}
    let "I += 2"
  done
}

function p2h () {
  while read x;
  do
    hex2string $x
  done
}
~ » echo 7400650073007400 | p2h
 test%

Outputting to a text file and opening it in VIM shows ^@ characters between each letter. Piping iconv -f UTF-16LE -t UTF-8 (the reverse of what was done to convert JSON data to the SQLite database) to the end seems to fix this, so the ^@ is probably due to a character conversion snafu