Skip to content

Commit 7efbc7d

Browse files
authored
Merge pull request #548 from eddieantonio/feature/gh-547-add-unicodedata-normalize
[WIP] Add unicodedata.normalize()
2 parents de5eb52 + 3526a75 commit 7efbc7d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: UTF-8 -*-
3+
4+
def normalize(form, unistr):
5+
# Delegate to ES6's method:
6+
# http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.normalize
7+
# Both ES6 and CPython require that `form` be the same four values.
8+
# https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Modules/unicodedata.c
9+
return String.prototype.normalize.call(unistr, form)

0 commit comments

Comments
 (0)