× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.