handling special characters in AIX with C - aix
This is a discussion on handling special characters in AIX with C - aix ; 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 ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| 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? |
|
#2
| |||
| |||
| avikrc18@gmail.com wrote: > 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? 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 |
|
#3
| |||
| |||
| avikrc18@gmail.com wrote: > 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? 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 you run it. Good luck. |
|
#4
| |||
| |||
|
On Nov 10, 1:54*am, Bob M > avikr...@gmail.com wrote: > > 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? > > 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 > you run it. > > Good luck. Perhaps you can try using the wide-character or multi-byte input routines. Thanks and regards, Rajbir Bhattacharjee |
|
#5
| |||
| |||
|
Maybe the iconv routines will help... man -k iconv... -Mike |
|
#6
| |||
| |||
|
A simpler method might just be to store the data in a session instead of rewriting it to the form in hidden fields. See below for PHP Sessions: If you absolutely need to put the data in hidden fields, you could try replacing new lines/carriage returns with a specific character (or characters), and then convert it back when you need to. Example, you could replace \n with "[br]", write it to the hidden form field, and then when you get it back, replace [br] with \n. |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 02:48 AM.




Linear Mode