Marc HB9CPW
2005-09-30 12:36:05 UTC
Hi *all
After some hours of reading, testing i can't find a solution for the
following problem:
I changed a little working sample program which writes a tab-delimited
file to the ifs.
When the program is used with CodePage 819 it works perfect.
I changed the codepage from 819 to 1208 UTF-8.
It is possible to create the file with codepage 1208 (checked with
OpsNav). But if the IFS-File is opened for writing, errorcode -1 appears
and nothing goes to the file.
Does anybody have a tip what has to be changed to get the UTF-8 file ?
Many thanks.
Marc
***** Code snipets below
The complete program is here (sorry some comments are in german):
*************************************************
http://mypage.bluewin.ch/hb9cpw/wrtifsutf8.ilerpg
*************************************************
d open pr 10i 0 extproc('open')
d filename * value
d openflags 10i 0 value
d mode 10u 0 value options(*nopass)
d codepage 10u 0 value options(*nopass)
d codepage s 10u 0 inz(1208)
c* create the file
c eval oflag = o_creat + o_codepage + o_rdwr
c eval omode = s_irwxu + s_iroth
c eval filename = %trim(filename) + null
c eval err_flag = open(%addr(filename)
c : oflag
c : omode
c : codepage
c )
c if err_flag < 0
c exsr e99
c endif
c*
c* close the file
c eval rc = close(err_flag)
c*
c* open the file
c eval oflag = o_wronly + o_textdata
c*
c eval err_flag = open(%addr(filename)
c : oflag
c )
c if err_flag < 0 <--- here -1
appears
c exsr e99
c endif
After some hours of reading, testing i can't find a solution for the
following problem:
I changed a little working sample program which writes a tab-delimited
file to the ifs.
When the program is used with CodePage 819 it works perfect.
I changed the codepage from 819 to 1208 UTF-8.
It is possible to create the file with codepage 1208 (checked with
OpsNav). But if the IFS-File is opened for writing, errorcode -1 appears
and nothing goes to the file.
Does anybody have a tip what has to be changed to get the UTF-8 file ?
Many thanks.
Marc
***** Code snipets below
The complete program is here (sorry some comments are in german):
*************************************************
http://mypage.bluewin.ch/hb9cpw/wrtifsutf8.ilerpg
*************************************************
d open pr 10i 0 extproc('open')
d filename * value
d openflags 10i 0 value
d mode 10u 0 value options(*nopass)
d codepage 10u 0 value options(*nopass)
d codepage s 10u 0 inz(1208)
c* create the file
c eval oflag = o_creat + o_codepage + o_rdwr
c eval omode = s_irwxu + s_iroth
c eval filename = %trim(filename) + null
c eval err_flag = open(%addr(filename)
c : oflag
c : omode
c : codepage
c )
c if err_flag < 0
c exsr e99
c endif
c*
c* close the file
c eval rc = close(err_flag)
c*
c* open the file
c eval oflag = o_wronly + o_textdata
c*
c eval err_flag = open(%addr(filename)
c : oflag
c )
c if err_flag < 0 <--- here -1
appears
c exsr e99
c endif