handling special characters in AIX with C
Hi,
I have this host which sends a text file in UTF-8 via ftp. But when my
program reads the file in AIX, it is not able to handle the German
umlaut character Ä which is in the file.
My program is in C. I am using AIX 4. The program opens the text file
and reads each character using fscanf(fp,"%c",&inChar) where fp is the
file pointer and inChar is the variable into which each character is
stored.
Any Idea how I can rectify this?
Re: handling special characters in AIX with C
[email]avikrc18@gmail.com[/email] wrote:[color=blue]
> Hi,
>
> I have this host which sends a text file in UTF-8 via ftp. But when my
> program reads the file in AIX, it is not able to handle the German
> umlaut character Ä which is in the file.
> My program is in C. I am using AIX 4. The program opens the text file
> and reads each character using fscanf(fp,"%c",&inChar) where fp is the
> file pointer and inChar is the variable into which each character is
> stored.
>
> Any Idea how I can rectify this?[/color]
3 obvious solutions:
- make people send a data file which your program can handle
- get gnu recode and convert the data file before running your program
- rewrite your program to handle "multibyte character sets". not sure if
there is an adequate compiler and libraries for the outdated aix 4, though.
regards
Joachim Gann
Re: handling special characters in AIX with C
[email]avikrc18@gmail.com[/email] wrote:
[color=blue]
> Hi,
>
> I have this host which sends a text file in UTF-8 via ftp. But when my
> program reads the file in AIX, it is not able to handle the German
> umlaut character Ä which is in the file.
> My program is in C. I am using AIX 4. The program opens the text file
> and reads each character using fscanf(fp,"%c",&inChar) where fp is the
> file pointer and inChar is the variable into which each character is
> stored.
>
> Any Idea how I can rectify this?[/color]
Perhaps after receiving the file you can run it through "tr" and translate
the identified character(s) into another character that you can process
correctly. Use command man tr for details and <inputfile >outputfile when
you run it.
Good luck.
Re: handling special characters in AIX with C
On Nov 10, 1:54*am, Bob M <r.mario...@fdcx.net> wrote:[color=blue]
> avikr...@gmail.com wrote:[color=green]
> > Hi,[/color]
>[color=green]
> > I have this host which sends a text file in UTF-8 via ftp. But when my
> > program reads the file in AIX, it is not able to handle the German
> > umlaut character Ä which is in the file.
> > My program is in C. I am using AIX 4. The program opens the text file
> > and reads each character using fscanf(fp,"%c",&inChar) where fp is the
> > file pointer and inChar is the variable into which each character is
> > stored.[/color]
>[color=green]
> > Any Idea how I can rectify this?[/color]
>
> Perhaps after receiving the file you can run it through "tr" and translate
> the identified character(s) into another character that you can process
> correctly. *Use command man tr for details and <inputfile >outputfile when
> you run it.
>
> Good luck.[/color]
Perhaps you can try using the wide-character or multi-byte input
routines.
Thanks and regards,
Rajbir Bhattacharjee
Re: handling special characters in AIX with C
Maybe the iconv routines will help... man -k iconv...
-Mike