Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. static PyObject *
  2. unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr)
  3. /*[clinic end generated code: output=484e8537d9ee8197 input=c4854798aab026e0]*/
  4. {
  5. int index;
  6. Py_UCS4 c = (Py_UCS4)chr;
  7. index = (int) _getrecord_ex(c)->east_asian_width;
  8. if (self && UCD_Check(self)) {
  9. const change_record *old = get_old_record(self, c);
  10. if (old->category_changed == 0)
  11. index = 0; /* unassigned */
  12. else if (old->east_asian_width_changed != 0xFF)
  13. index = old->east_asian_width_changed;
  14. }
  15. return PyUnicode_FromString(_PyUnicode_EastAsianWidthNames[index]);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement