<<< Date Index >>>     <<< Thread Index >>>

Re: Demoroniser (was: Display Filters)



On 2006-07-08, Alain Bench <veronatif@xxxxxxx> wrote:
>  On Friday, July 7, 2006 at 13:06:35 -0700, Gary Johnson wrote:

> > $ ldd /home/garyjohn/bin/SunOS/mutt
> >     libsocket.so.1 =>        /usr/lib/libsocket.so.1
> >     libnsl.so.1 =>   /usr/lib/libnsl.so.1
> >     libc.so.1 =>     /usr/lib/libc.so.1
> >     libdl.so.1 =>    /usr/lib/libdl.so.1
> >     libmp.so.2 =>    /usr/lib/libmp.so.2
> >     /usr/platform/SUNW,Sun-Fire-V240/lib/libc_psr.so.1
> > No libiconv!
> 
>     The Sun iconv functions are there somewhere, for sure (seen their
> action after my UTF-8 mail). Perhaps included in libc.so (nm and "grep
> iconv_open" might confirm).

    $ nm /usr/lib/libc.so.1 | grep iconv
    [4875]  |    265624|      56|FUNC |GLOB |0    |9      |_iconv
    [3443]  |    265536|      88|FUNC |GLOB |0    |9      |_iconv_close
    [4259]  |    263800|     176|FUNC |GLOB |0    |9      |_iconv_open
    [4489]  |    265624|      56|FUNC |WEAK |0    |9      |iconv
    [1122]  |         0|       0|FILE |LOCL |0    |ABS    |iconv.c
    [4630]  |    265536|      88|FUNC |WEAK |0    |9      |iconv_close
    [2992]  |    263800|     176|FUNC |WEAK |0    |9      |iconv_open
    [1130]  |    264776|     208|FUNC |LOCL |0    |9      |iconv_open_all
    [1134]  |    265180|     356|FUNC |LOCL |0    |9      |iconv_open_private
    [1131]  |    264984|     196|FUNC |LOCL |0    |9      |iconv_search_alias

Sure enough.

> > installed locally GNU libiconv-1.9.2
> 
>     BTW libiconv 1.10 has yet better and larger transliteration tables.

www.gnu.org/software/libiconv/ says the latest release is 1.9.2, so 
that's what I got.  I can see 1.10 in the ftp directory from which I 
downloaded 1.9.2.  What's the status of 1.10?

> > /bin/iconv
> 
>     Ahaa! Hopefully the Sun iconv command. Can you check:
> 
> | $ printf "\200 \203 \211\n" | /bin/iconv -f cp1252 -t us-ascii//TRANSLIT
> | EUR f o/oo

    $ printf "\200 \203 \211\n" | /bin/iconv -f cp1252 -t us-ascii//TRANSLIT
    Not supported cp1252 to us-ascii//TRANSLIT

>     But we should rather locate some authoritative list of Sun supported
> charsets. Hum...
> 
> | $ locale --charmaps | grep 1252     # or locale -m
> | CP1252

    $ locale --charmaps | grep 1252
    locale: illegal option -- -
    Usage: locale [-a|-m]
           locale [-ck] name ...
    $ locale -m | grep 1252

Nothing.

    $ locale -m
    iso_8859_1/charmap.src

> | $ /bin/iconv -l | grep 1252
> | CP1252 MS-ANSI WINDOWS-1252

    $ /bin/iconv -l | grep 1252
    /bin/iconv: illegal option -- l
    Usage: iconv -f fromcode -t tocode [file...]

    $ ls /usr/lib/iconv | grep 1252

Also nothing.

> | $ man 3 iconv_open          # but avoid the manpage that came with libiconv

    $ MANPATH=/usr/share/man man -s 3 iconv_open
    No entry for iconv_open in section(s) 3 of the manual.

(Sun's man requires the '-s'.)

    $ MANPATH=/usr/share/man man iconv_open

(It's in section 3C.)  No list.

However, 'MANPATH=/usr/share/man man iconv' mentions inconv(5) which
turns out to contain:

    NAME
         iconv - code set conversion tables

    DESCRIPTION
         The following code set conversions are supported:

So,

    $ MANPATH=/usr/share/man man -s 5 iconv | col -b | grep 1252

Still nothing.  Also tried this:

    $ find /usr/share/man -name \*iconv\*
    /usr/share/man/man5/iconv_en_US.UTF-8.5
    /usr/share/man/sman1/geniconvtbl.1
    /usr/share/man/sman1/iconv.1
    /usr/share/man/sman3c/iconv.3c
    /usr/share/man/sman3c/iconv_close.3c
    /usr/share/man/sman3c/iconv_open.3c
    /usr/share/man/sman4/geniconvtbl.4
    /usr/share/man/sman5/iconv.5
    /usr/share/man/sman5/iconv_1250.5
    /usr/share/man/sman5/iconv_1251.5
    /usr/share/man/sman5/iconv_646.5
    /usr/share/man/sman5/iconv_852.5
    /usr/share/man/sman5/iconv_8859-1.5
    /usr/share/man/sman5/iconv_8859-2.5
    /usr/share/man/sman5/iconv_8859-5.5
    /usr/share/man/sman5/iconv_dhn.5
    /usr/share/man/sman5/iconv_koi8-r.5
    /usr/share/man/sman5/iconv_mac_cyr.5
    /usr/share/man/sman5/iconv_maz.5
    /usr/share/man/sman5/iconv_pc_cyr.5
    /usr/share/man/sman5/iconv_unicode.5

and this:

    $ ls /usr/lib/iconv/geniconvtbl/binarytables/ | grep 1252
    ANSI-1252%UTF-8.bt
    ANSI-1252%utf-8.bt
    CP1252%UTF-8.bt
    UTF-8%ANSI-1252.bt
    UTF-8%CP1252.bt
    UTF-8%ansi-1252.bt
    ansi-1252%UTF-8.bt
    ansi-1252%utf-8.bt
    utf-8%ANSI-1252.bt
    utf-8%ansi-1252.bt

Finally!  So now:

    $ printf "\200 \203 \211\n" | /bin/iconv -f cp1252 -t utf-8
    Not supported cp1252 to utf-8
    $ printf "\200 \203 \211\n" | /bin/iconv -f CP1252 -t UTF-8
    â¬ Æ â°

It's case-sensitive.  How nice.

    $ ls /usr/lib/iconv/geniconvtbl/binarytables/ | grep -i ascii

Nothing.

    $ ls /usr/lib/iconv/geniconvtbl/binarytables/ | grep 8859
    ISO646%ISO8859-1.bt
    ISO8859-1%ISO646.bt

So it appears that this Sun installation can convert CP1252 to and
from UTF-8, but that's it.

>     You could also investigate the possible existence of a way to add
> aliases to the list, similar to the file /usr/lib/nls/iconv/config.iconv
> in HP-UX, or such.

I saw a reference to aliases in one of the iconv man pages, but I
don't think that will do me any good if the basic translation
capability isn't there.

>     In fact if you find such a list, I'm intersested: Could you please
> send it to me in full (privately)? For my own education. BTW is there a
> relation between SunOS version, and Solaris version?

I'll send you the iconv(5) man page and the listings of the
/usr/lib/iconv directories.  I also have access to HP-UX 10.20 and
HP-UX 11.0 systems, in case there is any info from those that you'd
like.  I don't know what the relation between SunOS and Solaris is.

Regards,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA