GNOME Bugzilla – Bug 637270
Allow showing invalid UTF-8 text
Last modified: 2018-04-15 00:24:18 UTC
Ideally it should render each broken byte as a hex box or something, with red background. Pango can be made to make that easier. There should also be API to query whether the buffer has invalid text in it. When fetching the text (for saving), the original text should be returned. Ie. invalid bytes should be retained. That's the major difference with this proposal and what PangoLayout does with invalid text (replace each invalid byte with (guchar)-1). See bug 502947 for background.
There is bug 610969. Could that serve as a starting point for this?
(In reply to comment #1) > There is bug 610969. Could that serve as a starting point for this? g_utf8_make_valid() replaces the invalid chars by another thing. Here we want to remember the invalid bytes so when we load and save a file (with gedit for example), if it contains invalid chars, they are not lost.
I think the first step here should be to write a somewhat comprehensive test case.
*** Bug 700581 has been marked as a duplicate of this bug. ***
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new