]> granicus.if.org Git - python/commit
Issue #27938: Add a fast-path for us-ascii encoding
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Sep 2016 22:40:10 +0000 (15:40 -0700)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Sep 2016 22:40:10 +0000 (15:40 -0700)
commit942889aae29af129ff1cb38a2dc75b94b97e65e6
treed7e062189c74e11c443f20a637a8931a06d716be
parenta9ab165cd272f1332333aa20565662e2c1a29468
Issue #27938: Add a fast-path for us-ascii encoding

Other changes:

* Rewrite _Py_normalize_encoding() as a C implementation of
  encodings.normalize_encoding(). For example, " utf-8 " is now normalized to
  "utf_8". So the fast path is now used for more name variants of the same
  encoding.
* Avoid strcpy() when encoding is NULL: call directly the UTF-8 codec
Objects/unicodeobject.c