On 2014-01-15, at 01:43, Jonathan Scott wrote:
>
> The ASMALTAS table used for TRANSLATE(AS) converts code page 037
> to code page 819 (ISO 8859-1), using a full 256-byte mapping.
>
And with a private translate table from IBM1047 to IBM037, I get
such as:
000AD 68 LB EQU C'['
000200 AD 69 DC AL1(LB)
000201 BA 70 DC C'['
Ouch, ouch, ouch!
Someone is likely to point out that the BYTE() BIF is my friend.
I think I'm beginning to understand about UTF-8 and PM75317.
If the programmer has DC C'UTF-8 stuff', and is cautious about
column 71, and ASMALTAS is in effect (is this the default for
Linux?), the assembled character constants will be usable as
UTF-8 because USASCII is a (proper) subset of UTF-8.
(Here's my translate table generator; guaranteed to not overlook tilde):
/* Rexx */ signal on novalue; /*
Doc: generate a HLASM TRANSLATE table.
*/
trace Err
address 'SYSCALL'
CP1 = 'IBM1047' /* Source code page. */
CP2 = 'IBM037' /* Target code page. */
'pipe P1.'
Chars = xrange( '00'x, 'ff'x )
'write 'P1.2' Chars' /* Surely the buffer is big enough. */
'close 'P1.2
'pipe P2.'
address 'SH' 'set -x; iconv -f 'CP1' -t 'CP2' <&'P1.1' >&'P2.2
'close 'P2.2
'read 'P2.1' Chars2 300'
Junk = length( Chars2 ) Chars2
say '< SETC ''ASMALT19'' from' CP1 'to' CP2
say '< CSECT'
do Const = 1 while Chars2>>''
parse value Chars2 with C 17 Chars2
say ' DC X'''c2x( C )'''' right( d2x( 240 - length( Chars2 ) ),
5 )
end Const
say ' DC CL8''<'''
say ' END'
exit( RC )
-- gil