Groups | Search | Server Info | Login | Register


Groups > comp.os.os2.programmer.porting > #54

Re: Problem: error in iconv_open

From "Mentore Siesto" <mentoreshoryu@fattimiei.zx>
Organization eComStation Developer Team
Message-ID <0KhBVN5juOdd-pn2-y6OCBd8jlKLB@neo_iii> (permalink)
Newsgroups comp.os.os2.programmer.porting
Subject Re: Problem: error in iconv_open
References <0KhBVN5juOdd-pn2-Od3ScT2CWGXd@neo_iii> <isilvu$ck7$1@tnews.hananet.net>
Date 2011-06-06 20:40 +0000

Show all headers | View raw


Il giorno Mon, 6 Jun 2011 13:50:55 UTC, KO Myung-Hun 
<komh@chollian.net> ha scritto:

> Hi/2.
> 
> Mentore Siesto wrote:
> > Hello all, this is a rather strange problem.
> > 
> > I was asked recently to try and port AESCrypt
> > 
> > http://www.aescrypt.com/linux_aes_crypt.html
> > 
> > make went fine after modifying the makefile. After making the 
> > executable file, though, testing it will always give me this:
> > 
> > [U:\progetti\aescrypt305_source\src]make -f makefile.os2 testfile
> > ./aescrypt -e -p "praxis" test.orig.txt
> > Error in iconv_open: Invalid argument
> > make: *** [testfile] Error 255
> > 
> > Searching the password.c file (which contains iconv_open) I came 
> > across these sentences:
> > 
> > /*
> >  *  passwd_to_utf16
> >  *
> >  *  Convert String to UTF-16LE for windows compatibility
> >  */
> > int passwd_to_utf16(char *in_passwd,
> >                     int length,
> >                     int max_length,
> >                     char *out_passwd)
> > {
> >     char *ic_outbuf,
> >          *ic_inbuf;
> >     iconv_t condesc;
> >     size_t ic_inbytesleft,
> >            ic_outbytesleft;
> > 
> >     ic_inbuf = in_passwd;
> >     ic_inbytesleft = length;
> >     ic_outbytesleft = max_length;
> >     ic_outbuf = out_passwd;
> > 
> >     if ((condesc = iconv_open("UTF-16LE", nl_langinfo(CODESET))) == 
> > (iconv_t)(-1))
> >     {
> >         perror("Error in iconv_open");
> >         return -1;
> >     }
> > 
> > The remainder of the function calls iconv to convert the given 
> > password and use it.
> > 
> > It seems that the error is caused by the nl_langinfo(CODESET) call, 
> > which gives (on my system) "en_US"; this seems to cause the iconv_open
> > error.
> > 
> > Of course I tried substituting it with other ideas, like using getenv 
> > to retrieve the locale, but still got errors.
> > 
> > I tried to learn how iconv and iconv_open work, but it seems rather 
> > confusing to me.
> > 
> > Would someone of you be so kind to suggest me a way to circumvent this
> > problem? Having AES Crypt available would be useful.
> > 
> > Thanks in advance!
> > Mentore
> 
> If you use kLIBC, it does not support UTF-16LE encoding. Instead, use
> UCS-2LE.
> 
> Or, if you really want to use UTF-16LE, you can use GNU libiconv as Dave
> Yeo said.
 
I was hoping to get such answers :)

Ok, first of all I'm going to try a different encoding and then GNU 
libiconv. Will keep you informed (next goal will be updating gnuplot!)

Thanks a lot, guys, you are invaluable as always.

Mentore

Back to comp.os.os2.programmer.porting | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Problem: error in iconv_open "Mentore Siesto" <mentoreshoryu@fattimiei.zx> - 2011-06-05 20:22 +0000
  Re: Problem: error in iconv_open Dave Yeo <dave.r.yeo@gmail.com> - 2011-06-05 15:16 -0700
  Re: Problem: error in iconv_open KO Myung-Hun <komh@chollian.net> - 2011-06-06 22:50 +0900
    Re: Problem: error in iconv_open "Mentore Siesto" <mentoreshoryu@fattimiei.zx> - 2011-06-06 20:40 +0000
    Re: Problem: error in iconv_open "Mentore Siesto" <mentoreshoryu@fattimiei.zx> - 2011-06-06 20:45 +0000
      Re: Problem: error in iconv_open Dave Yeo <dave.r.yeo@gmail.com> - 2011-06-06 16:41 -0700
        Re: Problem: error in iconv_open "Mentore Siesto" <mentoreshoryu@fattimiei.zx> - 2011-06-19 16:40 +0000
          Re: Problem: error in iconv_open Dave Yeo <dave.r.yeo@gmail.com> - 2011-06-19 11:30 -0700
            Re: Problem: error in iconv_open Ilya Zakharevich <nospam-abuse@ilyaz.org> - 2011-06-22 21:56 +0000
              Re: Problem: error in iconv_open "Mentore Siesto" <mentoreshoryu@fattimiei.zx> - 2011-07-09 10:37 +0000
                Re: SOLVED!: Problem: error in iconv_open "Mentore Siesto" <mentoreshoryu@fattimiei.zx> - 2011-07-10 18:24 +0000
                Re: SOLVED!: Problem: error in iconv_open "Lars Erdmann" <lars.erdmann@arcor.de> - 2011-07-10 20:41 +0200
                Re: SOLVED!: Problem: error in iconv_open "Mentore Siesto" <mentoreshoryu@fattimiei.zx> - 2011-07-10 22:33 +0000
                Re: SOLVED!: Problem: error in iconv_open vsvidya7@gmail.com - 2013-01-21 03:00 -0800
                Re: SOLVED!: Problem: error in iconv_open Dave Yeo <dave.r.yeo@gmail.com> - 2011-07-10 12:07 -0700
      Re: Problem: error in iconv_open Ilya Zakharevich <nospam-abuse@ilyaz.org> - 2011-06-08 00:45 +0000
        Re: Problem: error in iconv_open "Mentore Siesto" <mentoreshoryu@fattimiei.zx> - 2011-06-08 20:49 +0000
        Re: Problem: error in iconv_open piesse <piesse@despammed.com> - 2011-06-09 22:28 +0200
          Re: Problem: error in iconv_open Mentore <mentore.siesto@libero.it> - 2011-06-13 03:33 -0700

csiph-web