Linux HOWTOs

About | Home | Search

HOWTO: libiconv
Description: Library that handles character set encoding conversion
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# GNU libiconv 1.11
# =================
# Modern versions of glibc can do what this library does.  You most likely
# don't need this library unless your libc doesn't have a iconv() or if
# you want a better iconv() than the one that comes with glibc.

# If is busy, try ibiblio instead

# Prerequisites:
# gawk
# grep
# sed
# gettext

test -f installed/libiconv-1.11.tar.gz && mv installed/libiconv-1.11.tar.gz .
test ! -f libiconv-1.11.tar.gz &&

# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "b77a17e4a5a817100ad4b2613935055e  libiconv-1.11.tar.gz" | md5sum -c

# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "df09c3ef43443ac15c0c2d49fd791aa73a64bf30  libiconv-1.11.tar.gz" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 09718317 > /dev/null 2>&1 || gpg --recv-keys 09718317 ) &&
 wget -nc &&
  gpg --verify libiconv-1.11.tar.gz.sig && rm libiconv-1.11.tar.gz.sig

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "libiconv-*" -exec rm -r {} \;
tar xzvf ~/libiconv-1.11.tar.gz
cd libiconv-1.11
test $UID = 0 && chown -R root:root .
./configure --disable-nls

# Become root to install it

( cd /usr/local/lib ; rm -f libiconv.* libiconv_plug.* )
make install

# Become yourself again

mkdir -p -m 0700 installed
rm -f installed/libiconv-*.tar.gz
mv libiconv-1.11.tar.gz installed/

# Be aware that you probably have a /usr/include/iconv.h (from glibc) and
# a now a /usr/local/include/iconv.h (from libiconv).

# Now go to the gettext howto and re-build it

# If you ever want to uninstall libiconv, this should do it:
test -d src/libiconv-* && ( cd src/libiconv-* ; make uninstall )
test -d /usr/local/doc/libiconv &&
 rm -f /usr/local/doc/libiconv
( cd /usr/local/include ; rm -f iconv.h localcharset.h libcharset.h )
( cd /usr/local/lib
  rm -f libcharset.* libiconv.* )
test -d /usr/local/share/doc/libiconv &&
 rm -f /usr/local/share/doc/libiconv
( cd /usr/local/share/man/man3
  rm -f iconv.3 iconv_close.3 iconv_open.3 iconvctl.3 )
rm -f /usr/local/bin/iconv /usr/local/share/man/man1/iconv.1
find ~/src -maxdepth 1 -type d -name "libiconv-*" -exec rm -r {} \;
rm -f ~/installed/libiconv-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>