× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: iconv()
  • From: Carey Evans <c.evans@xxxxxxxxxxxx>
  • Date: 12 Jan 2000 20:55:22 +1300
  • User-Agent: Gnus/5.0803 (Gnus v5.8.3) XEmacs/21.1 (Bryce Canyon)

"Jason M. Felice" <jasonf@Baldwingroup.COM> writes:

> The aforementioned libiconv claims to map characters to similar-looking
> characters when it can't map them directly.

I downloaded this and had a look at it.  In the file NOTES, it talks
about which encodings are supported.  EBCDIC support doesn't seem to
be a goal:

  Q: Support EBCDIC ?
  A: No!

Still, it's licensed under the LGPL, and it looks easy to add new
single-byte encodings.

> Think think think think.... there should be no way to determine whether the
> current console font is iso-8859-1 or some other, huh?  Except for the
> locale, if they have that set, maybe?  Humm...

I've looked into this some more, and it looks like it should at least
be possible to use nl_langinfo() to get an encoding to use.  If it
actually matters to someone what encoding they use, they should
probably have $LANG set anyway.

----------------------------------------
/* langinfo.c */

#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <langinfo.h>

int
main(int argc, char **argv)
{
    const char *lang, *codeset;

    lang = (argc >= 2) ? argv[1] : "";
    setlocale(LC_ALL, lang);
    codeset = nl_langinfo(CODESET);
    printf("codeset = '%s'\n", codeset);

    exit(0);
}
----------------------------------------

$ ./langinfo C
codeset = 'ANSI_X3.4-1968'
$ ./langinfo en_NZ
codeset = 'ISO-8859-1'
$ ./langinfo hr_HR
codeset = 'ISO-8859-2'
$ ./langinfo ru_RU
codeset = 'ISO-8859-5'
$ ./langinfo ru_RU.KOI8-R
codeset = 'KOI8-R'

-- 
         Carey Evans  http://home.clear.net.nz/pages/c.evans/

CONFIG_IPL_RDR
  Select this option if you want to IPL the image from a real card reader.
+---
| This is the LINUX5250 Mailing List!
| To submit a new message, send your mail to LINUX5250@midrange.com.
| To subscribe to this list send email to LINUX5250-SUB@midrange.com.
| To unsubscribe from this list send email to LINUX5250-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.