Skip to content

[BUG] QR-code generation for connection sharing cannot handle unicode characters in Moniker #154

Description

@freQniK

When the moniker of a node has a non-latin unicode character it causes the app to crash after connecting. Debug output follows:

[INFO   ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "main\meile_gui.py", line 10, in <module>
   File "main\meile_gui.py", line 6, in main
   File "kivy\app.py", line 956, in run
   File "kivy\base.py", line 574, in runTouchApp
   File "kivy\base.py", line 339, in mainloop
   File "kivy\base.py", line 379, in idle
   File "kivy\clock.py", line 733, in tick
   File "kivy\clock.py", line 776, in post_idle
   File "kivy\_clock.pyx", line 620, in kivy._clock.CyClockBase._process_events
   File "kivy\_clock.pyx", line 653, in kivy._clock.CyClockBase._process_events
   File "kivy\_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
   File "kivy\_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
   File "kivyoav\delayed.py", line 14, in <lambda>
   File "kivyoav\delayed.py", line 13, in _apply
   File "ui\screens.py", line 544, in connect
   File "utils\qr.py", line 87, in generate_wg_qr_code
   File "PIL\ImageDraw.py", line 715, in textbbox
   File "PIL\ImageFont.py", line 187, in getbbox
 UnicodeEncodeError: 'latin-1' codec can't encode character '\u0151' in position 3: ordinal not in range(256)
[5212] Failed to execute script 'meile_gui' due to unhandled exception!

the crash happens at this line:

_, _, w, h = draw.textbbox((0, 0), text=str(label))

Metadata

Metadata

Assignees

Labels

WindowsWindows Bugs, Features, Requests, EnhancementsbugSomething isn't workinggood first issueGood for newcomerslinuxissues relating to linux buildosxissues relating to os x build

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions