bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ommiting header causes multibyte errors


From: Ariel
Subject: Re: ommiting header causes multibyte errors
Date: Thu, 7 Jun 2007 08:41:54 -0400 (EDT)


On Thu, 7 Jun 2007, Bruno Haible wrote:

Ariel wrote:
I'm trying to generate a .po file containing UTF-8 using --from-code=UTF-8
This is supported by xgettext.

If I run xgettext with --omit-header it gives errors:

This is normal. A POT or PO file that does not carry a character encoding
specification in the header entry is assumed to be in ASCII. xgettext notices
that its output would violate this rule and gives a warning and an error.

In that case I would have appreciated this being documented near the option for it, it would have saved me quite a bit of time.

If I omit the header, it's my responsibility to specify charset, etc.
elsewhere. xgettext should not assume it suddenly because ASCII.

No. The GNU gettext tools have been designed for maximum reliability. This
implies that the character encoding is specified in-line in the file, not
out of band.

Ok, I can understand that.

Actually, perhaps ever better: generate a minimal header whenever the source is non-ascii, and the option is on, since in that case the header is required rather then containing optional data.

For example:

Say I wanted to cat a bunch of .po files together, so I don't want a
header.

The GNU gettext tools provide two programs for this purpose:

I was just trying to think up reasons for not having a header, but I guess that wasn't a good one :)

Or the reason listed in the manual of removing a source of variance.

This is only for testing purposes. You can use plain ASCII when it's just for
testing.

This too should be documented, because it's not what the option looks like from reading the manual.

Or, in my case because I msgmerge to a file that already has a header, and
I want it exactly like that, without Report-Msgid-Bugs-To and
POT-Creation-Date.

msgmerge is not a tool for concatenating PO files. It's a tool for merging
updated translations from a translator with an updated POT file from the
programmer.

That's what I'm doing with it. I have an existing .po file, and I'm merging in new strings from my program.

If this doesn't cover your use case, please explain what you are trying to
do. The GNU gettext tools are designed to cover many use cases, while at
the same time avoiding to treat PO files like binary data (because that
would lead to encoding errors in many cases).

I just don't want the extra fields to appear in the file. I need to send it to someone very non-technical and I want the absolute minimum in the file.

Also, aesthetically, it looks bad to have a field which is empty, but looks like it should have something.

Perhaps msmerge could avoid adding lines to the header, if: the existing .po file has a header, and those fields aren't in it.

Or an option for xgettext to generate a minimal header - that would work just fine for the stated goal of avoiding variance.

        -Ariel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]