|
I thought I had solved this problem ages ago... Here goes.
I have an ILE C program that I run from QSH via soft-link created a la:
ln -fs /qsys.lib/mylib.lib/mypgm.pgm /home/thisguy/bin/myprogram
Program looks like this:
#include <stdio.h>
int main(int argc, char **argv) {
printf("Hello, world.\n") ;
printf("Hello, world.\n") ;
printf("You still here?\n!) ;
return 0 ;
}
(Exciting, I know.)
I can run this, and the output looks fine. I can also pipe my output
to a file (myprogram > /tmp/myfile.txt) and when I cat /tmp/myfile.txt,
everything looks fine.
But it is not. The "new line" character has been translated to 0x85
(or x'85' if you prefer). Job CCSID is 37. Shell created the file as
CCSID 819. WRKENVVAR shows QIBM_CCSID = 819.
The reason I noticed this is that I sent a file like this to a Windows
system using ASCII mode, and the Windows system shows no LF (of
course), and instead views it as one streamed line.
What would be the appropriate CCSID for me to use for such an
operation? Following on to that, should I (not) be able to specify one
CCSID for most purposes and be done with it (assuming I'm only using
IBM i, Windows and Linux systems in US English)? Or is CCSID even the
problem?!?! Maybe I should be using something other than "...\n" in my
printf() ?
--
Sent from my Galaxy tablet phone with with K-9 Mail. Please excuse my
brevity.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.