n***@rediffmail.com
2008-07-17 06:08:32 UTC
Hi,
I am new to Linux and trying to use popen. The code I am writing
eventually will _have_ to be internationalized. Being from windows, I
am trying to understand how UNICODE support should be added. On
windows I can use #ifdef and use _popen or _wpopen but on Linux that
doesn't seem to be the case.
After going through some posts I found that for commands that has non-
ascii characters, I need to convert them to ascii characters for popen
to accept them (and from what I have read it, it works).
But once the command completes successfully, again, from what I have
read so far, if the file contains unicode characters, fread/fgets
fails.
C++ perhaps could have helped with this but it seems there is no easy
way to convert "FILE" returned by popen to any of iostream objects.
I wanted to know if there is a recommended way to deal with this.
Please point to correct group to post this question if this isn't
correct one.
Thanks in advance,
-Neel.
I am new to Linux and trying to use popen. The code I am writing
eventually will _have_ to be internationalized. Being from windows, I
am trying to understand how UNICODE support should be added. On
windows I can use #ifdef and use _popen or _wpopen but on Linux that
doesn't seem to be the case.
After going through some posts I found that for commands that has non-
ascii characters, I need to convert them to ascii characters for popen
to accept them (and from what I have read it, it works).
But once the command completes successfully, again, from what I have
read so far, if the file contains unicode characters, fread/fgets
fails.
C++ perhaps could have helped with this but it seems there is no easy
way to convert "FILE" returned by popen to any of iostream objects.
I wanted to know if there is a recommended way to deal with this.
Please point to correct group to post this question if this isn't
correct one.
Thanks in advance,
-Neel.