Zim

Non-ASCII placeholder text is displayed incorrectly in InputEntry

Bug #1608734 reported by klg
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zim
Fix Committed
Low
Unassigned

Bug Description

Translated placeholder text ‘Search’ in the search entry on the toolbar is displayed incorrectly when it contains any non-ASCII characters. It shows a broken character and trailing part of it isn't grayed out. See the attachment showing example in Russian locale where it's pretty obvious (zim 0.65 on linux, gtk 2.24.30, pygtk 2.24.0).

It happens because zim.gui.widgets.InputEntry._show_placeholder_text attempts to apply styles (italic, gray) to whole placeholder text by taking len() of it and using this value as the ending index while pango.AttrStyle expects indices in number of bytes of UTF-8, not Unicode code points. Thus the ending point falls before the end of the text, and often in a middle of a character.

Revision history for this message
klg (klg.) wrote :
Revision history for this message
klg (klg.) wrote :
Changed in zim:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Committed in f32807de355fa4c931936ebf6e5924546e9e6650

Changed in zim:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.