Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Braille routing accuracy breaks in text with emoji #9034

Closed
LeonarddeR opened this issue Dec 8, 2018 · 1 comment
Closed

Braille routing accuracy breaks in text with emoji #9034

LeonarddeR opened this issue Dec 8, 2018 · 1 comment
Assignees
Labels
component/braille component/text-info TextInfo objects and text review z Python 3 transition (archived) Python 3 transition

Comments

@LeonarddeR
Copy link
Collaborator

Steps to reproduce:

  1. Open notepad
  2. Copy: Hello😉test😉cheese
  3. Route the cursor to the c of cheese with a braille display

Actual behavior:

Cursor ends up at h in cheese

Expected behavior:

Cursor ends up at c in cheese

Explanation

When routing a braille display in a TextInfoRegion, NVDA counts the number of characters in the text of the region, creates a text info at the start of the reading unit and moves it n characters. However, in most controls, including NVDA's default offsets implementation #8953), eemoji are treated as one character while they take up two characters in Python 2 unicode strings and in liblouis' output. As noted in #8953, Gecko and Chrome treat emoji as two characters as well.

Proposed fix

This would be fixed by Python 3, but Python 3 creates other issues regarding offset based text infos that also need to be addressed. Another fix would be compiling liblouis with UCS-4 support (#6695). I have a working branch that fixes this for controls like Notepad, Word, UIA etc. but it recreates the bug the other way around for Gecko and Chrome.

@LeonarddeR
Copy link
Collaborator Author

Fixed in #9044. We'll leave this as is in Python 2 builds for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/braille component/text-info TextInfo objects and text review z Python 3 transition (archived) Python 3 transition
Projects
None yet
1 participant