Commits

Anonymous committed 9c324c9

use utf-8 as encoder/decoder name consistently (not utf8)

  • Participants
  • Parent commits 039fd52
  • Branches 2.4x

Comments (0)

Files changed (7)

File benchmark/marc21.py

 
 
 def uni(v):
-    return u"" if v is None else v.decode("utf8", "replace")
+    return u"" if v is None else v.decode("utf-8", "replace")
 
 
 # Indexing and searching
                    glob=options.glob)
 
     if args:
-        qstring = " ".join(args).decode("utf8")
+        qstring = " ".join(args).decode("utf-8")
         limit = int(options.limit)
         if limit < 1:
             limit = None

File src/whoosh/analysis.py

-# coding: utf8
+# coding: utf-8
 
 # Copyright 2007 Matt Chaput. All rights reserved.
 #

File src/whoosh/codec/base.py

                 # term if it's greater than the last one
                 if lastspell is None or spellterm > lastspell:
                     # TODO: how to decode the btext bytes?
-                    self.add_spell_word(fieldname, btext.decode("utf8"))
+                    self.add_spell_word(fieldname, btext.decode("utf-8"))
                     lastspell = spellterm
                 continue
 

File src/whoosh/lang/phonetic.py

-#encoding: utf8
+#encoding: utf-8
 
 """
 This module contains quasi-phonetic encoders for words in different languages.

File src/whoosh/support/bench.py

                                           schema=ix.schema)
 
     def query(self):
-        qstring = " ".join(self.args).decode("utf8")
+        qstring = " ".join(self.args).decode("utf-8")
         return self.parser.parse(qstring)
 
     def find(self, q):

File src/whoosh/util.py

     the prefix it shares with a, followed by the suffix encoded as UTF-8.
     """
     i = first_diff(a, b)
-    return chr(i) + b[i:].encode("utf8")
+    return chr(i) + b[i:].encode("utf-8")
 
 
 def prefix_encode_all(ls):
     last = u('')
     for w in ls:
         i = first_diff(last, w)
-        yield chr(i) + w[i:].encode("utf8")
+        yield chr(i) + w[i:].encode("utf-8")
         last = w
 
 
     last = u('')
     for w in ls:
         i = ord(w[0])
-        decoded = last[:i] + w[1:].decode("utf8")
+        decoded = last[:i] + w[1:].decode("utf-8")
         yield decoded
         last = decoded
 

File tests/test_tables.py

-# encoding: utf8
+# encoding: utf-8
 
 from __future__ import with_statement
 import random