After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789230 - glib-mkenums expects C files to be in UTF-8 encoding
glib-mkenums expects C files to be in UTF-8 encoding
Status: RESOLVED DUPLICATE of bug 785113
Product: glib
Classification: Platform
Component: general
2.54.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-10-20 07:17 UTC by Martin Husemann
Modified: 2017-10-23 11:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Martin Husemann 2017-10-20 07:17:35 UTC
This is an invalid assumption, and it makes compiling xfce4 engines impossible, several of their source files have a copyright from Tomas Ögren and are encoded in ISO8859-1.

I get:

Making all in gtk-3.0
gmake[2]: Entering directory '/usr/pkgobj/x11/xfce4-gtk2-engine/work/gtk-xfce-en
gine-3.2.0/gtk-3.0'
Traceback (most recent call last):
  • File "/usr/pkg/bin/glib-mkenums", line 688 in <module>
    Traceback (most recent call last):
  • File "/usr/pkg/bin/glib-mkenums", line 688 in <module>
    process_file(fname)
  • File "/usr/pkg/bin/glib-mkenums", line 420 in process_file
    process_file(fname)
  • File "/usr/pkg/bin/glib-mkenums", line 420 in process_file
    line = curfile.readline()
  • File "/usr/pkg/lib/python2.7/codecs.py", line 314 in decode
    line = curfile.readline()
  • File "/usr/pkg/lib/python2.7/codecs.py", line 314 in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)     (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd6 in position 980: invalid continuation byte
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd6 in position 980: invalid continuation byte
Makefile:737: recipe for target 'xfce_typebuiltin.h' failed
Comment 1 Philip Withnall 2017-10-20 09:07:26 UTC
This is a duplicate of bug #788283. Re-encode the files as UTF-8. GLib and GTK+ expect basically all string literals to be encoded in UTF-8 anyway.

We should mention this in the documentation for glib-mkenums and glib-genmarshal though. Patches welcome.
Comment 2 Philip Withnall 2017-10-23 11:26:15 UTC
Actually, there’s some work ongoing to replace invalid encodings with `?` when decoding, and to warn rather than failing.

See https://bugzilla.gnome.org/show_bug.cgi?id=785113#c20 onwards.

*** This bug has been marked as a duplicate of bug 785113 ***