Skip to content

Commit

Permalink
Merge pull request #548 from eddieantonio/feature/gh-547-add-unicoded…
Browse files Browse the repository at this point in the history
…ata-normalize

[WIP] Add unicodedata.normalize()
  • Loading branch information
JdeH committed Aug 31, 2018
2 parents de5eb52 + 3526a75 commit 7efbc7d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions transcrypt/modules/unicodedata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

def normalize(form, unistr):
# Delegate to ES6's method:
# http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.normalize
# Both ES6 and CPython require that `form` be the same four values.
# https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Modules/unicodedata.c
return String.prototype.normalize.call(unistr, form)

0 comments on commit 7efbc7d

Please sign in to comment.