Crash when non-BMP chars are displayed
Closed this issue · 3 comments
When non-BMP chars are displayed, nvPY shows an error dialog and exit. To improve usability in ucs2 environment, should consider how to continue execution.
The current promising proposal is:
- Detect ucs2 environment.
- Replace non-BMP chars to � (0xFFFD; REPLACEMENT CHARACTER) and display the note in read-only mode.
I confirmed that nvpy crashes immediately without any error dialog when I enter some emojis to a textbox. Despite using tcl built with UCS4 support...
Reproduction procedure
- Clean install ubuntu 20.04 to the Virtual Machine.
- Build tcl, tk, and python3 with UCS4 support. See ./docs/ucs-4.rst.
echo '[nvpy]' >~/.nvpy.cfg
- Start nvpy.
- Create a new note and type some emojis like
:thinking:
🤔. The nvpy crashes immediately, and it will show an error message in the terminal.
X Error of failed request: BadLength (poly request too large or internal Xlib length error)
Major opcode of failed request: 139 (RENDER)
Minor opcode of failed request: 20 (RenderAddGlyphs)
Serial number of failed request: 37363
Current serial number in output stream: 37382
I give up for adding UCS4 support to current nvpy. I will reimplement UI with GTK3 to solve this issue.
Related issue: #6
UPDATE: Tk 8.6.13 almost solves it.
I was about to the point where I was going to look into upgrading to the next Ubuntu LTS release just to get a newer libtk
, when I found this blog post. The author suggests
sudo apt install unifont
…which solved this problem for me.
No data on what the non-BMP characters look like, because I have hundreds, maybe thousands of notes, and at the moment, I don't have a quick way to comprehensively search through all of them to find which ones have wide characters. Although, I suppose, Perl could do it.