GNOME Bugzilla – Bug 651783
"Failed to convert UTF-8 string to JS string" for Persian specific unicode letters
Last modified: 2012-08-27 20:16:42 UTC
A while ago I faced this bug: https://bugzilla.redhat.com/show_bug.cgi?id=704893 In brief, running Firefox in fa_IR locale generates lots of "Failed to convert UTF-8 string to JS string" exceptions in gnome shell. After some investigation, I found the exact reason: in Firefox translation in the branding section, 'Firefox' is translated to 'فایرفاکس', which contains some Arabic letters and two Persian specific unicode letters: Persian/Farsi Yeh, and Persian/Farsi Keh (or Kaf. I don't know the exact unicode name). If these letters, or other Persian specific letters such as "Zhe" appears in an string, gnome-shell is unable to convert that UTF-8 string to JS string with the above error messages. This bug is sever and makes gnome-shell almost unusable when such letters appear in an application name (given by app.get_name()). Thanks
Well, looks like that this is a problem with Firefox only... I'm confused. Maybe firefox has conversion problems, since it seems the even without those problematic letters, the firefox title in the top bar and Alt+Tab doesn't appear correctly and is not readable. The same thing is true for firefox in other languages like Arabic: while it doesn't produce the mentioned problems, the title doesn't appear correctly in the top bar and Alt+Tab list, and is not readable.
I suspect that there is something wrong with firefox encoding. However, gnome shell should handle situations where the string cannot be converted to JS string gracefully, rather than losing the focus of all windows when trying to switch between them using Alt+tab, which requires a restart of gnome-shell and closing the problematic application.
This was a gjs/libmozjs bug that should have been fixed recently (bug #643479). Are you still seeing this?
It seems that gjs has not updated in Fedora 15 yet, so I'm not sure if I can try the new fix currently. I'll try again as soon as a new update appeared for Fedora.
Firefox have fixed it's branding translation bug (it is not translated at all), so the bug doesn't appear normally. However, if I change the branding, I'll get the same error messages and keyboard stops working in gnome-shell 3.2. (I'm using gjs-1.30).
_NET_WM_NAME is defined to be a UTF8_STRING, and .desktop files are defined to be UTF-8. If an application puts strings in the locale enconding instead of UTF-8 there, it's not a gnome-shell bug, so I'm tentatively closing this NOTGNOME.