bugGNU gettext - Bugs: bug #49955, xgettext parses wrongly hex...


You are not allowed to post comments on this tracker with your current authentication level.

bug #49955: xgettext parses wrongly hex escapes in concatenated literals

Submitter:  Chusslove Illich <caslav_ilic>
Submitted:  Thu 29 Dec 2016 10:18:47 PM UTC
Category:  C Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:
       No canned response available


Sun 04 Nov 2018 11:43:01 PM UTC, comment #2: 

It is indeed a duplicate of bug #46756, and it is fixed now.
Thanks for the report.

Bruno Haible <haible>
Project Administrator
Fri 30 Dec 2016 02:30:05 AM UTC, comment #1: 

I think this is a duplicate of:

Thanks for the report and the analysis, anyway.

Daiki Ueno <ueno>
Project Administrator
Thu 29 Dec 2016 10:18:47 PM UTC, original submission:  

The following two messages are same, but the first one produces "invalid multibyte sequence" warnings, when extracted using xgettext --from-code=UTF-8 concat-literal-hex-escape-01.c (attached):

  gettext("1 foobarqwyx" "\xc2\x9c" "1 fbq");
  gettext("1 foobarqwyx" "\u009c" "1 fbq");

It appears parsing works by first concatenating the literal, and then resolving escapes, so "...\x9c" "1..." is interpreted as "...\x9c1...". When e.g. a space is inserted before 1 in the last literal segment, extraction works (single message in the POT).

Chusslove Illich <caslav_ilic>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by caslav_ilic (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-04 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed
    2018-01-06 haible CategoryProgrammer tools C
    2016-12-29 caslav_ilic Attached File- Added concat-literal-hex-escape-01.c, #39329

    Back to the top

    Powered by Savane 3.9