I have the following code on Linux:-
rc = iconv_open("WCHAR_T", SourceCode);
prior to using iconv
to convert the data into a wide character string (wchar_t
).
I am now compiling this on z/OS. I do not know what value to use in place of "WCHAR_T"
. I have found that codepages are represented by 5-digit character strings on z/OS, e.g Codepage 500 would be "00500"
, so I am happy enough with what to put into my SourceCode
variable above, I just can't find a value that will successfully work as the first parameter to iconv_open
.
wchar_t
are 4 bytes long on z/OS (when compiling 64-bit as I am), so I assume that I would need some varient of an EBCDIC equivalent to UTF32 or UCS4 perhaps, but I cannot find something that works. Every combination I have tried to date has returned with an errno
of 121 (EINVAL: The parameter is incorrect).
If anyone familiar with how the above code works on Linux, could give a summary of what it does, that might also help. What does it mean to iconv
into "WCHAR_T"
? Is this a combination perhaps, of some data conversion and additionally a type change to wchar_t
?
Alternatively, can anyone answer the question, "What is the internal representation of wchar_t
on z/OS?"