OK, I am back in the office (unexpected family issue)
I have Scotts program CH5ASCII working but there are a few characters not converting correctly
Couple of examples:
Hex 5A Latin Capital letter G with Breve above Ğ displays as a Ð
Hex 5B Latin Capital letter I with dot above İ displays as a Ý
Most of the characters are fine
but want to make sure I have done it correctly.
I want to create an ASCII file with Turkey characters in it from code page 1026
I want the file to have code page 1252 assigned to it in the IFS (I think)
Running V5R3
System value QCCSID 65535
System value QCHRID 697 37
Is this correct values to accomplish this:
...
C EVAL fd = open('/TEMP/ifstest/ch5_file.txt':
C O_CREAT + O_CCSID + O_TEXTDATA
C + O_TEXT_Creat + O_WRONLY
C + O_INHERITMODE
C :0
C :1252
C :1026)
...
C EVAL line = 'Hex 5A-5F '
C + X'5A5B5C5D5E5F'
C EVAL len = %len(%trimr(line))
C CALLP writeline(fd: %addr(line): len)
...
Notepad shows: Hex 5A-5F ÐÝ*);^
(Appears first two turkish characters are not correct)
Anyone have any ideas why some of the characters are not working.
This whole Code Page/CCSID stuff is rather confusing the more I look into it the more confused I become.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of John Allen
Sent: Friday, June 01, 2012 5:01 PM
To: 'RPG programming on the IBM i / System i'
Subject: RE: Attempting to write to IFS andmissing turkish characters
I see that now, thanks
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Barbara Morris
Sent: Friday, June 01, 2012 4:28 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Attempting to write to IFS andmissing turkish characters
On 2012/6/1 3:14 PM, John Allen wrote:
My bad, When I changed pgm from open/create/close/open I left the
close in so I was writing to a closed file
Surprised I did not get an error, when attempting to write to closed
file??
Are you checking the return value from the write? The IFS APIs are return-code-based rather than exception-based, so you have to detect errors rather than handle errors.
bytes_written = write(file : buf : bytes);
if bytes_written < bytes;
... an error occurred, details are in errno
endif;
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
I am using the free version of SPAMfighter.
We are a community of 7 million users fighting spam.
SPAMfighter has removed 3574 of my spam emails to date.
Get the free SPAMfighter here:
http://www.spamfighter.com/len
The Professional version does not have this message
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.