Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc742b3

Browse files
committed
Marc-Andre Lemburg:
Added a few missing whitespace Unicode char mappings. Thanks to Brian Hooper.
1 parent 8666291 commit dc742b3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Objects/unicodectype.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,8 @@ int _PyUnicode_IsNumeric(register const Py_UNICODE ch)
633633

634634
#ifndef WANT_WCTYPE_FUNCTIONS
635635

636-
/* Returns 1 for Unicode characters having the type 'WS', 'B' or 'S',
637-
0 otherwise. */
636+
/* Returns 1 for Unicode characters having the bidirectional type
637+
'WS', 'B' or 'S' or the category 'Zs', 0 otherwise. */
638638

639639
int _PyUnicode_IsWhitespace(register const Py_UNICODE ch)
640640
{
@@ -649,6 +649,8 @@ int _PyUnicode_IsWhitespace(register const Py_UNICODE ch)
649649
case 0x001E: /* RECORD SEPARATOR */
650650
case 0x001F: /* UNIT SEPARATOR */
651651
case 0x0020: /* SPACE */
652+
case 0x0085: /* NEXT LINE */
653+
case 0x00A0: /* NO-BREAK SPACE */
652654
case 0x1680: /* OGHAM SPACE MARK */
653655
case 0x2000: /* EN QUAD */
654656
case 0x2001: /* EM QUAD */
@@ -661,7 +663,9 @@ int _PyUnicode_IsWhitespace(register const Py_UNICODE ch)
661663
case 0x2008: /* PUNCTUATION SPACE */
662664
case 0x2009: /* THIN SPACE */
663665
case 0x200A: /* HAIR SPACE */
666+
case 0x200B: /* ZERO WIDTH SPACE */
664667
case 0x2028: /* LINE SEPARATOR */
668+
case 0x2029: /* PARAGRAPH SEPARATOR */
665669
case 0x202F: /* NARROW NO-BREAK SPACE */
666670
case 0x3000: /* IDEOGRAPHIC SPACE */
667671
return 1;

0 commit comments

Comments
 (0)