30. Character transformation between utf-8, ascii and ebcdic

Example 30.1

)action out='q1'

"Alas my love"

"You do me wrong"

"To cast me off"

"Discourteously"

)endaction

)action in='q1'

)& func='>utf8'

)& outfile='yrsa'

)& outfunc='browse'

unit.1

)endaction

The example transforms the text using character representation utf-8, writing the file to dataset <user>.yrsa.data

Notice ISPF browse primary command ==> display utf8, which makes utf-8 characters readable.

 

Example 30.2

)action infile='yrsa'

)& func='<utf8'

unit.1

)endaction

The example assumes input being in character representation utf-8, converting it to ebcdic. The result is a re-creation of the original file from example 30.1 above.

 

The following transformations exists:

 

func='>utf8'

Transforms ebcdic characters to utf-8

func='<utf8'

Transforms utf-8 characters to ebcdic

func='>ascii'

Transforms ebcdic characters to ascii

func='<ascii'

Transforms ascii characters to ebcdic

 

Character transformation is mostly used when - but not limited to - communicating to and from UNIX and PC.