Title: Invisible bidi control characters survive parsing and pollute output · Issue #266 · derek73/python-nameparser · GitHub
Open Graph Title: Invisible bidi control characters survive parsing and pollute output · Issue #266 · derek73/python-nameparser
X Title: Invisible bidi control characters survive parsing and pollute output · Issue #266 · derek73/python-nameparser
Description: Text copied from web pages, PDFs, or Word documents frequently carries invisible Unicode bidirectional control characters — most commonly the right-to-left mark U+200F around RTL names. The parser doesn't strip them, so they end up embed...
Open Graph Description: Text copied from web pages, PDFs, or Word documents frequently carries invisible Unicode bidirectional control characters — most commonly the right-to-left mark U+200F around RTL names. The parser ...
X Description: Text copied from web pages, PDFs, or Word documents frequently carries invisible Unicode bidirectional control characters — most commonly the right-to-left mark U+200F around RTL names. The parser ...
Opengraph URL: https://github.com/derek73/python-nameparser/issues/266
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invisible bidi control characters survive parsing and pollute output","articleBody":"Text copied from web pages, PDFs, or Word documents frequently carries invisible Unicode bidirectional control characters — most commonly the right-to-left mark U+200F around RTL names. The parser doesn't strip them, so they end up embedded in the parsed attributes:\n\n```python\n\u003e\u003e\u003e from nameparser import HumanName\n\u003e\u003e\u003e hn = HumanName(\"\\u200fمحمد بن سلمان\\u200f\")\n\u003e\u003e\u003e hn.first\n'\\u200fمحمد'\n\u003e\u003e\u003e hn.first == \"محمد\"\nFalse\n```\n\n(The `\\u200f` escapes are written out here because the character is invisible; real-world input contains the raw character.)\n\nBecause the characters are invisible, the corruption is silent: values print normally but fail equality comparisons, lookups, and deduplication downstream. Constants lookups can also miss (a title or prefix with a mark glued to it no longer matches its set entry).\n\n**Suggested fix:** strip bidi control characters during pre-processing, exactly as emoji are already handled (#58, `re_emoji` in `nameparser/config/regexes.py`). The relevant characters: U+200E (LRM), U+200F (RLM), U+061C (ALM), U+202A–U+202E (embedding/override), U+2066–U+2069 (isolates).\n\nObserved on v1.3.0.\n","author":{"url":"https://github.com/derek73","@type":"Person","name":"derek73"},"datePublished":"2026-07-07T20:43:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/266/python-nameparser/issues/266"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a8d943f4-8cc3-4b1b-a98d-29b19c04ad4c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D874:16F599:4C90572:6BC65AA:6A571157 |
| html-safe-nonce | 3c2a29486f2292f9d69132927d7160ae2ac2e60a2c526c93244db74e0c122683 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODc0OjE2RjU5OTo0QzkwNTcyOjZCQzY1QUE6NkE1NzExNTciLCJ2aXNpdG9yX2lkIjoiMzkwMTk2NDQzMjg1MTgwMDQwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8608f1ae2ad806f3160082d175c96a873d44b4602c70acf40666d07692a385ac |
| hovercard-subject-tag | issue:4832087810 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/derek73/python-nameparser/266/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0d82ea23570c36cc57d045f2e60d99a2df2a5de04ada2fa25a56454ea2700df0/derek73/python-nameparser/issues/266 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0d82ea23570c36cc57d045f2e60d99a2df2a5de04ada2fa25a56454ea2700df0/derek73/python-nameparser/issues/266 |
| og:image:alt | Text copied from web pages, PDFs, or Word documents frequently carries invisible Unicode bidirectional control characters — most commonly the right-to-left mark U+200F around RTL names. The parser ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | derek73 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| turbo-cache-control | no-preview |
| go-import | github.com/derek73/python-nameparser git https://github.com/derek73/python-nameparser.git |
| octolytics-dimension-user_id | 18306 |
| octolytics-dimension-user_login | derek73 |
| octolytics-dimension-repository_id | 18353524 |
| octolytics-dimension-repository_nwo | derek73/python-nameparser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 18353524 |
| octolytics-dimension-repository_network_root_nwo | derek73/python-nameparser |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width