msgfmt produces invalid UTF-8 sequences for desktop files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gettext (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Confirmed
|
Low
|
Unassigned |
Bug Description
VIM has recently added support for validating gnome desktop files and this is reporting errors due to invalid UTF-8 sequences produced by msgfmt.
Steps to reproduce:
1. Checkout rev 1253704 from the VIM git repo on GitHub - https:/
2. Run ./configure in the repo to set up the build environment.
2. Change to the po directory in the repo - cd src/po
3. Process and validate the gvim desktop file using the Makefile -
$ make gvim.desktop
msgfmt --desktop -d . --template gvim.desktop.in -o tmp_gvim.desktop
rm -f LINGUAS
if command -v desktop-
/usr/bin/
tmp_gvim.desktop: warning: file contains lines that are not UTF-8 encoded. There is no guarantee the validator will correctly work.
[Invalid UTF-8] tmp_gvim.desktop: error: value "\xe0\xac\
Makefile:176: recipe for target 'gvim.desktop' failed
make: *** [gvim.desktop] Error 1
The template file has valid UTF-8 sequences so no errors are expected. The error is correct as the generated desktop file has a truncated 3 byte UTF-8 sequence at the end of the line as reported. The problem is msgfmt is emitting an invalid UTF-8 sequence for this one line.
This is happening on an up to date 16.04 LTS -
$ apt list gettext desktop-file-utils
Listing... Done
desktop-
gettext/
There has been some discussion of this issue on the VIM developers mailing list - https:/
A candidate patch for the issue from upstream for the gettext package has been identified -
https:/
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: gettext 0.19.7-2ubuntu3.1
ProcVersionSign
Uname: Linux 4.15.0-51-generic i686
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: i386
CurrentDesktop: Unity
Date: Fri Jun 7 10:30:31 2019
InstallationDate: Installed on 2019-02-05 (121 days ago)
InstallationMedia: Ubuntu 16.04.5 LTS "Xenial Xerus" - Release i386 (20180731)
SourcePackage: gettext
UpgradeStatus: No upgrade log present (probably fresh install)
I can reproduce the error in a xenial VM, not in a bionic one.