delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/06/17:52:39

From: "Juan Manuel Guerrero" <ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De>
Organization: Darmstadt University of Technology
To: salvador <salvador AT inti DOT gov DOT ar>
Date: Mon, 6 Aug 2001 23:52:07 +0200
Subject: Re: gettext port
CC: djgpp-workers AT delorie DOT com
X-mailer: Pegasus Mail for Windows (v2.54DE)
Message-ID: <37D62CF01F8@HRZ1.hrz.tu-darmstadt.de>
Reply-To: djgpp-workers AT delorie DOT com

On Mon, 06 Aug 2001, salvador wrote:

> > The codepage used by libiconv.a is read ones and can not be changed while the program
> > is running.
> 
> Can I disable the use of libiconv.a? I want to: (a) avoid innecesary translations and
> (b) avoid binary bloat.

The only way to disable the use of libiconv.a is to have not installed it at all.
More precise: the gettext configure script checks if libiconv.a is installed
on the system (if you rename $DJDIR/include/iconv.h, then the test will fail).
If the lib is found it is used and the user has no option to disable this feature.
If you want a full functional libintl.a but without the runtime recoding capability,
this would be a libintl.a like the one of gettext-0.10.35, you must rename iconv.h
or not install libiconv.a (licv17b.zip) at all.
The generated libintl.a is full functional.


> Can I force gettext to avoid conversions?
> I ask it because my text editor can switch code pages on the fly (and if you are in a
> DOS console with text mode you can ask the editor to create and load the appropiate font).

AFAIK, no. Translations are handled using the gettext(), dgettext and dcgettext() family
of functions. For all these functions, if a translation is found in one of the specified
catalogs, then it is converted to the locale's charset and the result is returned as a
statically allocated string. If your editor can switch codepages on the fly and create and
load fonts, I would suggest that you build your one version of libintl.a without recode capability.
Anyway, I would seriously suggest to read the man pages for gettext() and bind_textdomain-codeset().
The last one explains how you can change the output codepage at runtime. In programs like sed or
grep, that run only once and have no user interaction, this function is never used. But for programs
that allow user interaction, like editors, bind_textdomain-codeset() allows you to reinitialize the
structure passed to the iconv_open() function with appropiate input and output charsets.


> > Last but not least, I have reconfigured and recompiled gettext-0.10.39 but this time without
> > libiconv. Of course all .po files have been recoded apriori using the recode program so runtime
> > recoding via build-in libiconv is not needed anymore. A comparation between xgettext.exe from
> > gtxt039b.zip and the newone shows:
> >  xgettext.exe with libiconv (from the port available at simtel):    689648 bytes
> >  xgettext.exe without libiconv (newone):                             72480 bytes
> 
> 8-)

This has really been a very unfortunate and misleading formulation. It was never my intention to
insinuate that all binaries compiled with libiconv.a will be bloated by a factor 10. Indeed,
I have only compared the 5 or 6 binaries from gtxt039b.zip. As Eli correctely pointed out,
the overhead is additive and no multiplicative.

Regards,
Juan M. Guerrero

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019