Closed Bug 943296 Opened 9 years ago Closed 7 years ago
Drag Service .cpp should assume Gtk uses UTF-8
widget/gtk/nsDragService.cpp calls nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode and nsPrimitiveHelpers::ConvertUnicodeToPlatformPlainText. Since we already assume that *nix platforms use UTF-8 as the platform encoding these days, nsDragService should just assume UTF-8, too.
(In reply to Henri Sivonen (:hsivonen) from comment #0) > Since we already > assume that *nix platforms use UTF-8 as the platform encoding these days, > nsDragService should just assume UTF-8, too. That's not quite the right reason to fix this. The right reason is that for APIs other than those that deal with file system paths, Gtk has been UTF-8-only since version 2. The code in question here was migrated from Gtk1 until in compiled under Gtk2--leaving around cruft that was no longer needed or even correct--when it should have been rewritten as UTF-8-only for Gtk2 like nsClipboard.cpp was during the Gtk2 migration.
The old code uses C strings instead of XPCOM strings. That's sad but out of scope for this patch.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Comment on attachment 8672971 [details] [diff] [review] Assume UTF-8, v2 As you hint, this should all be replaced by gtk_selection_data_set_text()/_get_text()/_uris(), a bit like nsClipboard. Some code could even be shared. This patch is kind of a step in that direction, thanks.
Attachment #8672971 - Flags: review?(karlt) → review+
You need to log in before you can comment on or make changes to this bug.