bugGNU gettext - Bugs: bug #52395, msguniq for Windows...


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

bug #52395: msguniq for Windows sometimes processes .pot file with CRLF EOL incorrectly

Submitted by:  Hendy Irawan <ceefour>
Submitted on:  Sat 11 Nov 2017 05:36:43 PM UTC  
Category: Translator toolsSeverity: 3 - Normal
Item Group: NoneStatus: Confirmed
Privacy: PublicAssigned to: None
Open/Closed: Open

Sun 12 Nov 2017 10:24:19 PM UTC, comment #2:

As a workaround, if you have PO or POT files with Windows EOL conventions, please run "tr -d '\r'" on them before using the GNU gettext tools on them.

Bruno Haible <haible>
Project Administrator
Sun 12 Nov 2017 10:22:58 PM UTC, comment #1:

I observe the bug also on Linux, but only with an additional --width argument:
$ msguniq --to-code=utf-8 -w 200 eolbug.pot > eolbug.out

The resulting eolbug.out has a first line that looks like this:
#: .\edu\templates\edu\home.html:69<CR> #: .\edu\templates\edu\music_country.html:34<CR>

No information has been lost; you only got that impression because the second part on the line overwrote the first part on the screen.

But a stray <CR>, not succeeded by <LF>, is evidently causing trouble in editors and possibly syntax errors in some other tools.

(file #42379, file #42380)

Bruno Haible <haible>
Project Administrator
Sat 11 Nov 2017 05:36:43 PM UTC, original submission:

eolbug.pot file : (save it as CRLF EOL)

#: .\edu\templates\edu\home.html:69
#: .\edu\templates\edu\music_country.html:34
#, python-format
msgid "Hi"
msgstr ""

then run:

msguniq --to-code=utf-8 eolbug.pot


#: .\edu\templates\edu\home.html:69
#: .\edu\templates\edu\music_country.html:34
#, python-format
msgid "Hi"
msgstr ""


warning: Could not open file /usr/share/gettext/styles/po-default.css

#, python-format
msgid "Hi"
msgstr ""

(the warning is ok, but resulting output has incorrect syntax and lost information)

But if the file is using LF EOL, file is processed fine.

Original bug report: https://code.djangoproject.com/ticket/28773

Hendy Irawan <ceefour>


Attached Files
file #42379:  eolbug.pot added by haible (124B - text/plain)
file #42380:  eolbug.out added by haible (118B - application/octet-stream)


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 claudep
  • -email is unavailable- added by ceefour (Submitted the item)
  • -email is unavailable- added by ceefour

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 12 Nov 2017 10:22:58 PM UTChaibleAttached File-=>Added eolbug.pot, #42379
      Attached File-=>Added eolbug.out, #42380
      CategoryBuild=>Translator tools
    Sat 11 Nov 2017 08:49:28 PM UTCclaudepCarbon-Copy-=>Added claudep
    Sat 11 Nov 2017 05:36:43 PM UTCceefourCarbon-Copy-=>Added ceefour

    Back to the top

    Powered by Savane 3.1-cleanup1