cpbotha / nvpy

Simplenote syncing note-taking application, inspired by Notational Velocity and ResophNotes, but uglier and cross-platformerer.
Other
849 stars 114 forks source link

Crash when non-BMP chars are displayed #189

Closed yuuki0xff closed 11 months ago

yuuki0xff commented 5 years ago

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:

yuuki0xff commented 3 years ago

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

  1. Clean install ubuntu 20.04 to the Virtual Machine.
  2. Build tcl, tk, and python3 with UCS4 support. See ./docs/ucs-4.rst.
  3. echo '[nvpy]' >~/.nvpy.cfg
  4. Start nvpy.
  5. 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

yuuki0xff commented 11 months ago

UPDATE: Tk 8.6.13 almost solves it.

ernstki commented 1 month ago

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.