Bug 86012

Summary: variable with UTF8 content: Invalid byte sequence in conversion input
Product: pkg-config Reporter: Adam Lackorzynski <adam>
Component: srcAssignee: Dan Nicholson <dbn.lists>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: adam
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Adam Lackorzynski 2014-11-07 16:43:37 UTC
Hi,

using variable contents with UTF8, yields the following:

pkg-config> ./pkg-config --define-variable=x=รถ pkg-config
Invalid byte sequence in conversion input
pkg-config> echo $?
1
pkg-config> git rev-parse HEAD
0e847a2201ace5e53e474c52ad5b51e70607980e
(current master)

Glib is version 2.42.0-2 (Debian sid).

In our particular use-case we put a path name into a variable and that path contains UTF8 characters.
Comment 1 Dan Nicholson 2014-11-11 20:46:56 UTC
Unfortunately, pkg-config doesn't currently handle non-ASCII correctly. You can add a call to 'setlocale(LC_ALL, "")' at the beginning of main to get past this error (g_option validating the input), but later you'll likely not get back the results you expected.

In particular, strdup_escape_shell(), the function used by the parser to escape special shell characters, make the assumption that it's operating on an ASCII byte string. This should get fixed, but I don't expect it to happen really soon. Sorry.
Comment 2 GitLab Migration User 2018-08-25 12:53:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/19.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.