Re: DEF(__STRING_CODESET__)?

2 views
Skip to first unread message

Paul Gilmartin

unread,
Dec 22, 2020, 12:34:28 PM12/22/20
to IBM Mainframe Discussion List, ISPF-List
(cross-posting)
On 2020-12-22, at 09:31:06, Kirk Wolf wrote:
>
> This is the way that we do it -
>
> #pragma convert("ISO8859-1")
> const char* ASCII_LITERAL = "a literal string in ISO8859-1";
> #pragma convert(pop)
>
I'm more interested in the wildly popular UTF-8. On my
desktop I can:
791 $ locale
LC_CTYPE="en_US.UTF-8"
...
792 $ echo aπb | sed 's/../x/'
xb

The regex substitution converts the first two characters,
the 'a' and the 'π' to the 'x'.

Suppose I'm Editing a similar file with ISPF Edit, CTYPE UTF-8,
which ISPF supports, and a CP875 terminal (which ISPF supports
but I don't have). How does the analogous Edit command do
its magic:
Change r'..' 'x'

-- gil

Kirk Wolf

unread,
Dec 23, 2020, 11:06:35 AM12/23/20
to ispf-...@nd.edu, IBM Mainframe Discussion List
OK then:

#pragma convert("UTF-8")

Kirk Wolf
Dovetailed Technologies


--
You received this message because you are subscribed to the Google Groups "ISPF discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispf-l-list...@nd.edu.
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/5A734CA8-A226-4486-A988-3A0DC4D3DD06%40AIM.com.

Paul Gilmartin

unread,
Dec 23, 2020, 11:56:28 AM12/23/20
to ISPF-List, IBM Mainframe Discussion List
On 2020-12-23, at 09:06:18, Kirk Wolf wrote:
>
> OK then:
>
> #pragma convert("UTF-8")
>
Thanks.

But that's a single instance. ISPF Edit supports 56 terminal
code pages, listed in the Ref., and numerous code pages for
subject files. I don't know where they're listed; perhaps
anything that LE supports. There's a caution that metacharacters
in regular expressions will be intereprete according to the
CCSID of the controlling terminal. How? I'm envisioning
an enormous "switch" with a "case" and a pragma for each.

The support is magnificent. A file tagged with CCSID is
rendered correctly, within the capability of the terminal.
UTF-8 file and Cyrillic terminal just works.

Puzzlingly, I see no mention of locale sensitivity in the
Ref. for regcomp().

Interpreting metacharacters in regex according to the terminal
CCSID makes it impractical to author portable Edit macros
containing regex.


> > This is the way that we do it -
> >
> > #pragma convert("ISO8859-1")
> > const char* ASCII_LITERAL = "a literal string in ISO8859-1";
> > #pragma convert(pop)
> >
> I'm more interested in the wildly popular UTF-8.

Thanks again,
gil

Paul Gilmartin

unread,
Dec 23, 2020, 11:57:44 AM12/23/20
to ISPF-List, IBM Mainframe Discussion List
On 2020-12-23, at 09:06:18, Kirk Wolf wrote:
>
> OK then:
>
> #pragma convert("UTF-8")
>
Thanks.

But that's a single instance. ISPF Edit supports 56 terminal
code pages, listed in the Ref., and numerous code pages for
subject files. I don't know where they're listed; perhaps
anything that LE supports. There's a caution that metacharacters
in regular expressions will be intereprete according to the
CCSID of the controlling terminal. How? I'm envisioning
an enormous "switch" with a "case" and a pragma for each.

The support is magnificent. A file tagged with CCSID is
rendered correctly, within the capability of the terminal.
UTF-8 file and Cyrillic terminal just works.

Puzzlingly, I see no mention of locale sensitivity in the
Ref. for regcomp().

Interpreting metacharacters in regex according to the terminal
CCSID makes it impractical to author portable Edit macros
containing regex.


>> This is the way that we do it -
>>
>> #pragma convert("ISO8859-1")
>> const char* ASCII_LITERAL = "a literal string in ISO8859-1";
>> #pragma convert(pop)
>>
> I'm more interested in the wildly popular UTF-8.

Thanks again,
gil

Reply all
Reply to author
Forward
0 new messages