|
I was using ASCII control characters as an example. Windows text
editors typically look for the combination of CR and LF characters to
break a new line, whereas many Unix environments will recognize just
the
LF character.
Try to insert both characters into your print stream and see how the
Windows text editor handles it.
Jason Abreu
Abreu Innovations, Inc.
jason.abreu@xxxxxxxxxxxxxxxxxxxx
http://www.abreuinnovations.com/
On 3/9/2011 3:41 PM, Mark S. Waterbury wrote:
Oh, wow ... I thought this was going to be about Logical Files ...*:-/*
la:
> On 3/9/2011 3:32 PM, Dennis wrote:
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
/tmp/myfile.txt,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
Windowseverything 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
onesystem 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
theCCSID 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
myproblem?!?! Maybe I should be using something other than "...\n" in
myprintf() ?
--
Sent from my Galaxy tablet phone with with K-9 Mail. Please excuse
--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.