× 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.



There was a thread on conversion in september 2005. At that time Elvis advised 
me to play with iconv function.
I now tried to find the test program I wrote that time, but failed :-(
I recall, that I made a cycle on <toCcsid.CcsidNbr> and the results where 
funny. There where VERY FEW values, that the function was ready to convert from 
00037. So it is not the problem of programming, but rather the combination of 
"TO" and "FROM".

That time I found the solution to my problem elsewhere, but I can tell you for 
sure, that you should not be surprised by this error message. Maybe someone 
will tell what causes it.
Maybe the answer is in library QUSRSYS in files of type *TBL.

Jevgeni.


> -----Original Message-----
> From: Davis Yokana [mailto:dyokana@xxxxxxxxxxx]
> Sent: Friday, April 07, 2006 10:36 AM
> To: c400-l@xxxxxxxxxxxx
> Subject: [C400-L] problems with iconv_open
> 
> 
> Hello:
> 
> This code:
> 
> >    iconv_t cd;                                              
>                                         
> >    struct {                                                 
>                                         
> >       char IBMCCSID[8];                                     
>                                         
> >       char CcsidNbr[5];                                     
>                                         
> >       char convAlt[3];                                      
>                                         
> >       char subAlt;                                          
>                                         
> >       char shiftStateAlt;                                   
>                                         
> >       char inputLenOpt;                                     
>                                         
> >       char errorOpt;                                        
>                                         
> >       char reserved[12];                                    
>                                         
> >       } fromCcsid;                                          
>                                         
> >       strncpy(&fromCcsid.IBMCCSID[0],"IBMCCSID",8);         
>                                         
> >       strncpy(&fromCcsid.CcsidNbr[0],"00037",5);  // 
> "00000" also does not work                                    
>               
> >      strncpy(&fromCcsid.convAlt[0],"000",3); // "102" also 
> does not work either                         
> >      fromCcsid.subAlt         =  '0';                       
>                                   
> >      fromCcsid.shiftStateAlt  =  '0';                       
>                                   
> >      fromCcsid.inputLenOpt    =  '0';                       
>                                   
> >      fromCcsid.errorOpt       =  '0';  // '1' does not work either 
> >   memset((void *)&fromCcsid.reserved[0],0x00,12);           
>                                   
> >   struct {                                                  
>                                   
> >      char IBMCCSID[8];                                      
>                                   
> >      char CcsidNbr[5];                                      
>                                   
> >      char reserved[19];                                     
>                             
> >     } toCcsid;                                              
>                              
> >    strncpy(&toCcsid.IBMCCSID[0],"IBMCCSID",8);              
>                              
> >    strncpy(&toCcsid.CcsidNbr[0],"00850",5);                 
>                              
> >    memset((void *)&toCcsid.reserved[0],0x00,19);            
>                              
> >    cd = iconv_open ((char *)&fromCcsid,(char *)&toCcsid);   
>                              
> >    if(cd.return_value == -1){    
> 
> generates the following error msg:
> 
> The value specified for the argument is not correct. 
> 
> which is the text associated with errno. This is V5R2. I am 
> trying to do ebcdic to ascii translation. 
> I would much appreciate any ideas anyone might have.
> 
> Sincerely,
> 
> -Davis Yokana                                                      
> 
> -- 
> This is the C programming iSeries / AS400 (C400-L) mailing list
> To post a message email: C400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/c400-l
> or email: C400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/c400-l.
> 
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.