Note that an EBCDIC DEL is 07.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of Bill Godfrey <bgodfrey...@gmail.com> Sent: Monday, February 10, 2020 6:52 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: UTF16 to EBCDIC On Mon, 10 Feb 2020 12:21:58 -0600, Paul Gilmartin <paulgboul...@aim.com> wrote: >On Mon, 10 Feb 2020 07:58:26 -0600, Bill Godfrey wrote: > >>Given a USS file utf16.txt containing 6 UTF-16 characters, 12 bytes: >> >>>od -tx1 -An utf16.txt >> 00 28 20 1C 00 61 20 1D 00 29 00 0A >> >>U+0028 is left parenthesis >>U+201C is left double quotation mark >>U+0061 is small letter "a" >>U+201D is right double quotation mark >>U+0029 is right parenthesis >> >>There are no correstponding quotation marks in EBCDIC 1047. >>The iconv command converts them to hex 3F. >> >>>iconv -f 1200 -t ibm-1047 <utf16.txt | od -tx1 -tc -An >> 4D 3F 81 3F 5D 15 >> ( 077 a 077 ) \n >> >I submitted an RCF a couple days ago. This should be documented. > >Hex 3F is SUBstitute, intended as a substitute for untranslatable >characters. Good. If the target code page is ASCII-based, does it >produce the corresponding hex 1A? It should despite the risk that >CP/M (and old MS-DOS?) misused SUB as end-of-text-file. Hex 1A for iso8859-1, but 7F for 437. $ iconv -f 1200 -t iso8859-1 <utf16.txt | od -tx1 -An 28 1A 61 1A 29 0A $ iconv -f 1200 -t 437 utf16.txt | od -tx1 -An 28 7F 61 7F 29 0A Bill ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN