You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Collins-Sussman <su...@collab.net> on 2004/06/24 14:09:49 UTC

compile warnings from msgfmt

For a couple of weeks now, every time I compile my /trunk working copy,
it always ends with these warnings:


sed '/^"Content-Type: text\/plain; charset=UTF-8\\n"$/d'
subversion/po/de.po > subversion/po/de.spo
/usr/local/bin/msgfmt -o subversion/po/de.mo subversion/po/de.spo
/usr/local/bin/msgfmt: subversion/po/de.spo: warning: Charset missing in
header.                                                      Message
conversion to user's charset will not work.
sed '/^"Content-Type: text\/plain; charset=UTF-8\\n"$/d'
subversion/po/nb.po > subversion/po/nb.spo
/usr/local/bin/msgfmt -o subversion/po/nb.mo subversion/po/nb.spo
/usr/local/bin/msgfmt: subversion/po/nb.spo: warning: Charset missing in
header.                                                      Message
conversion to user's charset will not work.
rm subversion/po/de.spo subversion/po/nb.spo


I'm running RH9, using GNU gettext 0.13.  What's all this about "missing
charsets" in the header?  (FWIW, the default terminal locale on RH9 is
en_US.UTF-8, if that's relevant.)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH) compile warnings from msgfmt

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Sun, 27 Jun 2004, Greg Hudson wrote:

> > About the long names: they are verbose, but consistent with what
> > autoconf uses (HAVE_functionname). I added IF_ for as a prefix when
> > the condition is true and IF_NOT_ when it is false.
>
> Uh, sure, you're consistent with the symbol names autoconf uses for C
> code, but I don't see why this matters.  But if you look at other
> real-life examples of people doing Makefile conditionalization using
> this approach, they almost always use short symbol names for
> conciseness.  (When they're not using automake, that is.)
>
> You aren't using AC_DEFINE on these symbols, so they won't affect the
> C code namespace, only the Makefile namespace.  I suggest using
> @NO_CHARSET@.
>
Thanks for the suggestion. I used GETTEXT_CODESET and NO_GETTEXT_CODESET.
Had to split the sed line anyway...

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH) compile warnings from msgfmt

Posted by Greg Hudson <gh...@MIT.EDU>.
> About the long names: they are verbose, but consistent with what
> autoconf uses (HAVE_functionname). I added IF_ for as a prefix when
> the condition is true and IF_NOT_ when it is false.

Uh, sure, you're consistent with the symbol names autoconf uses for C
code, but I don't see why this matters.  But if you look at other
real-life examples of people doing Makefile conditionalization using
this approach, they almost always use short symbol names for
conciseness.  (When they're not using automake, that is.)

You aren't using AC_DEFINE on these symbols, so they won't affect the
C code namespace, only the Makefile namespace.  I suggest using
@NO_CHARSET@.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH) compile warnings from msgfmt

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 24 Jun 2004, Greg Hudson wrote:

> On Thu, 2004-06-24 at 18:25, Peter N. Lundblad wrote:
> > Here is a patch that gets rid of the warnings if bind_textdomain_codeset
> > is available. This is Portabilityland, where I am a stranger, so please
> > could someone have a look.
>
> It looks functionally okay, but you should restrict lines to 80
> characters when possible, and @IF_NOT_HAVE_BIND_TEXTDOMAIN_CODESET@ is
> perhaps a bit verbose.
>
The only problematic line is the sed line to remove the Content-type
header. I don't know where it is safe to break this line.

About the long names: they are verbose, but consistent with what autoconf
uses (HAVE_functionname). I added IF_ for as a prefix when the condition
is true and IF_NOT_ when it is false.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH) compile warnings from msgfmt

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2004-06-24 at 18:25, Peter N. Lundblad wrote:
> Here is a patch that gets rid of the warnings if bind_textdomain_codeset
> is available. This is Portabilityland, where I am a stranger, so please
> could someone have a look.

It looks functionally okay, but you should restrict lines to 80
characters when possible, and @IF_NOT_HAVE_BIND_TEXTDOMAIN_CODESET@ is
perhaps a bit verbose.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH) compile warnings from msgfmt

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 24 Jun 2004, Greg Hudson wrote:

> On Thu, 2004-06-24 at 13:58, Peter N. Lundblad wrote:
> > I'm not sure how to implement this portably. Is the make if construct
> > portable?
>
> Not particularly, no.
>
I found the POSIX specification for make. That was instructive to read...

> A common trick is to stick @SYMBOL@ in Makefile.in and define @SYMBOL@
> to either "#" or "" depending on whether the Makefile fragment should be
> enabled.
>
Yes, like automake does I think. I choose this trick. It looks ugly, but
it works.

Here is a patch that gets rid of the warnings if bind_textdomain_codeset
is available. This is Portabilityland, where I am a stranger, so please
could someone have a look.

Regards,
//Peter

Re: compile warnings from msgfmt

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2004-06-24 at 13:58, Peter N. Lundblad wrote:
> I'm not sure how to implement this portably. Is the make if construct
> portable?

Not particularly, no.

A common trick is to stick @SYMBOL@ in Makefile.in and define @SYMBOL@
to either "#" or "" depending on whether the Makefile fragment should be
enabled.

Another common trick is to do a runtime check using the shell if
construct, which is portable.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: compile warnings from msgfmt

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 24 Jun 2004, Ben Collins-Sussman wrote:

> On Thu, 2004-06-24 at 09:33, Branko Čibej wrote:
>
> > You're a bit behind the times, arean't you? :-)
> >
> > These warnings are expected, and are the result of our stripping the
> > Content-Type header from the .po files. And we strip that to make sure
> > some gettext doesn't try to convert the messages to some local encoding,
> > because we need them in UTF-8. We can't use bind_textdomain_codeset,
> > because that's GNU-gettext-specific. This was all discussed on the list
> > a while ago.
>
> I'm still on my high-horse about "make should never produce warnings".
> Maybe we can suppress the output somehow.  :-(
>
I've been thinking of testing for bind_textdomain_codeset and avoid the
stripping if it is available. I would think the warning is specific to GNU
gettext, but I'm not sure. This would probably avoid many user questions.
This would also make life easier for translators, since as it stand now,
error messages refer to a temporary file (.spo) which doesn't exist
afterwards.

I'm not sure how to implement this portably. Is the make if construct
portable?

//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: compile warnings from msgfmt

Posted by Tobias Ringström <to...@ringstrom.mine.nu>.
Greg Hudson wrote:

>On Thu, 2004-06-24 at 10:37, Ben Collins-Sussman wrote:
>  
>
>>I'm still on my high-horse about "make should never produce warnings". 
>>Maybe we can suppress the output somehow.  :-(
>>    
>>
>Well, it has been theorized, and I think it is likely, that if a gettext
>implementation doesn't have bind_textdomain_codeset, then it won't be
>doing charset translation anyway.  So, I continue to believe that the
>right answer is to test for this function with autoconf and use it if it
>is present, and leave the charset declaration in the file.
>  
>
FWIW, I agree completely.

/Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: compile warnings from msgfmt

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2004-06-24 at 10:37, Ben Collins-Sussman wrote:
> I'm still on my high-horse about "make should never produce warnings". 
> Maybe we can suppress the output somehow.  :-(

Well, it has been theorized, and I think it is likely, that if a gettext
implementation doesn't have bind_textdomain_codeset, then it won't be
doing charset translation anyway.  So, I continue to believe that the
right answer is to test for this function with autoconf and use it if it
is present, and leave the charset declaration in the file.

(Certainly, the idea that an implementation won't do charset translation
if it doesn't have bind_textdomain_codeset seems at least as likely as
the idea that an implementation won't attempt charset translation if it
sees no charset declaration.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: compile warnings from msgfmt

Posted by Ben Collins-Sussman <su...@collab.net>.
On Thu, 2004-06-24 at 09:33, Branko Čibej wrote:

> You're a bit behind the times, arean't you? :-)
> 
> These warnings are expected, and are the result of our stripping the 
> Content-Type header from the .po files. And we strip that to make sure 
> some gettext doesn't try to convert the messages to some local encoding, 
> because we need them in UTF-8. We can't use bind_textdomain_codeset, 
> because that's GNU-gettext-specific. This was all discussed on the list 
> a while ago.

Cripes, stupid musical theater's got me out of the loop.  I'll check the
~dast archives.

I'm still on my high-horse about "make should never produce warnings". 
Maybe we can suppress the output somehow.  :-(



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: compile warnings from msgfmt

Posted by Branko Čibej <br...@xbc.nu>.
Ben Collins-Sussman wrote:

>For a couple of weeks now, every time I compile my /trunk working copy,
>it always ends with these warnings:
>
>
>sed '/^"Content-Type: text\/plain; charset=UTF-8\\n"$/d'
>subversion/po/de.po > subversion/po/de.spo
>/usr/local/bin/msgfmt -o subversion/po/de.mo subversion/po/de.spo
>/usr/local/bin/msgfmt: subversion/po/de.spo: warning: Charset missing in
>header.                                                      Message
>conversion to user's charset will not work.
>sed '/^"Content-Type: text\/plain; charset=UTF-8\\n"$/d'
>subversion/po/nb.po > subversion/po/nb.spo
>/usr/local/bin/msgfmt -o subversion/po/nb.mo subversion/po/nb.spo
>/usr/local/bin/msgfmt: subversion/po/nb.spo: warning: Charset missing in
>header.                                                      Message
>conversion to user's charset will not work.
>rm subversion/po/de.spo subversion/po/nb.spo
>
>
>I'm running RH9, using GNU gettext 0.13.  What's all this about "missing
>charsets" in the header?  (FWIW, the default terminal locale on RH9 is
>en_US.UTF-8, if that's relevant.)
>  
>
You're a bit behind the times, arean't you? :-)

These warnings are expected, and are the result of our stripping the 
Content-Type header from the .po files. And we strip that to make sure 
some gettext doesn't try to convert the messages to some local encoding, 
because we need them in UTF-8. We can't use bind_textdomain_codeset, 
because that's GNU-gettext-specific. This was all discussed on the list 
a while ago.

-- Brane


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org