How to print a UTF-8 unicode string as EBCDIC in PL/I

155 Views Asked by At

How can I instruct PL/I to print a UTF-8 value as EBCDIC. Is there a "trick" in PL/I or do I have to call the z/OS unicode services to convert the UTF-8 value?

PUT SKIP EDIT('VAR: ',VAR) (A,A);

Using the above instruction gives unreadable output.

VAR: &   (!¢  
1

There are 1 best solutions below

0
cschneid On

Try UTF8TOCHAR, which appears to be new with IBM Enterprise PL/I version 5.

PUT SKIP EDIT('VAR: ',UTF8TOCHAR(VAR)) (A,A);

That's just freehand, but I think you get the idea.