Only consider emoji characters with emoji presentation to have width two

Fixes #308
This commit is contained in:
Kovid Goyal
2018-02-04 22:27:34 +05:30
parent b667e3a577
commit b9857f9499
6 changed files with 302 additions and 204 deletions

View File

@@ -334,7 +334,7 @@ class TestDataTypes(BaseTest):
def test_utils(self):
def w(x):
return wcwidth(ord(x))
self.ae(tuple(map(w, 'a1\0コニチ ')), (1, 1, 0, 2, 2, 2, 1))
self.ae(tuple(map(w, 'a1\0コニチ ')), (1, 1, 0, 2, 2, 2, 1, 1))
self.assertEqual(sanitize_title('a\0\01 \t\n\f\rb'), 'a b')
def test_color_profile(self):