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



I need help getting a UTF-8 file to convert to CCSID 37.  All I need is to
be able to read them into a database file.  I've read some of the archive
posts on iconv() and that open() should be able to handle this for me.  I
feel like I must be missing a tiny piece of the puzzle.  I've changed the
file on the IFS to have a CCSID code of 1208, and when I use WRKLNK to view
it, it looks like a normal file.  Here is the code:

/free                                                   
  myfile = '/attachment/UTF-8.txt';                     
  openflags = O_RDONLY + O_TEXTDATA;                    
  mode = S_IRUSR + S_IRGRP + S_IROTH;                   
  CCSID_UTF8 = 1208;
                                                        
  fd = open( myfile                                     
           : openflags                                  
           : mode                                       
           : CCSID_UTF8        );                       

When I run this, I get the message CPE3490: Conversion error.  One or more
characters could not be converted from the source CCSID to the target CCSID.

The file itself contains just "This is a test".  (Hex: EFBBBF54 68697320
69732061 20746573 742E).

Any ideas on what I'm missing, or how I can accomplish this?
Carmen


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.