title: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 105: invalid continuation byte
body: <p>My code is pretty much the following :</p>
  
  <pre><code>import sqlitefts as fts
  
  connection = apsw.Connection('texts.db', flags=apsw.SQLITE_OPEN_READWRITE)
  c = connection.cursor()
  def do_search(query):
      c.execute('SELECT title, book, author, link, snippet(text_idx) FROM text_idx  WHERE text_idx MATCH 'possumus';') #in this case query='possumus'
      c.fetchall()
  --display the results on html--
  </code></pre>
  
  <p>the query works if i search for more than a single word. But when i do single word searches it throws me an decoding error.</p>
  
  <p>Query that doesn't work are similar to the following: </p>
  
  <p>single word searches like -</p>
  
  <pre><code>SELECT title, book, author, link, snippet(text_idx) 
  FROM text_idx  
  WHERE text_idx MATCH 'possumus'; 
  </code></pre>
  
  <p>and <strong>OR</strong> searches like</p>
  
  <pre><code>SELECT title, book, author, link, snippet(text_idx) 
  FROM text_idx  
  WHERE text_idx MATCH 'quam OR Galliae';
  </code></pre>
  
  <p>The stack trace is:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1997, in __call__
      return self.wsgi_app(environ, start_response)
    File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1985, in wsgi_app
      response = self.handle_exception(e)
    File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1540, in handle_exception
      reraise(exc_type, exc_value, tb)
    File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 33, in reraise
      raise value
    File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1982, in wsgi_app
      response = self.full_dispatch_request()
    File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1614, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1517, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 33, in reraise
      raise value
    File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1612, in full_dispatch_request
      rv = self.dispatch_request()
    File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1598, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File "/home/ramcharran/phyllo/search/app.py", line 123, in search
      r = do_search(query)
    File "/home/ramcharran/phyllo/search/app.py", line 90, in do_search
      r1 = c.fetchall()
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 105: invalid continuation byte
  </code></pre>
  
  <p>The query works fine if I do not use the <code>snippet()</code> function in my query.</p>