× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have some methods that parse text of different CCSID's. I have a job CCSID literal that I translate into the appropriate data CCSID. That works most of the time, but in some cases it just didn't seem to work. I just gave up and used different hex constants.



-----Original Message-----
From: Tools/400 [mailto:thomas.raddatz@xxxxxxxxxxx]
Sent: Friday, February 17, 2017 3:54 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Question about Code pages and writing file directly to IFS with RPG program

John,

I had similar problems with WSDL2RPG. I solved these problems by using
%char() and unicode constants like this:

D QUOTE C u'0022'
D OPEN_ANGLE C u'003C'
D CLOSE_ANGLE C u'003E'

io_msgCtx.header.contentType.start =
%char(OPEN_ANGLE) + i_partID + %char(CLOSE_ANGLE);

Or I use init procedures like this:

*
D isInit S N inz(cFalse) static
D esc_from S 10A Dim(5) varying static
D esc_to S 10A Dim(5) varying static
*
* Constants
D cESC_FROM_1 C U'0026'
D cESC_FROM_2 C U'003E'
D cESC_FROM_3 C U'0022'
D cESC_FROM_4 C U'003C'
D cESC_FROM_5 C U'0027'
*
D cESC_TO_1 C U'00260061006D0070003B'
D cESC_TO_2 C U'002600670074003B'
D cESC_TO_3 C U'002600710075006F0074003B'
D cESC_TO_4 C U'0026006C0074003B'
D cESC_TO_5 C U'002600610070006F0073003B'

if (not isInit);
esc_from(1) = %char(cESC_FROM_1);
esc_from(2) = %char(cESC_FROM_2);
esc_from(3) = %char(cESC_FROM_3);
esc_from(4) = %char(cESC_FROM_4);
esc_from(5) = %char(cESC_FROM_5);
esc_to(1) = %char(cESC_TO_1);
esc_to(2) = %char(cESC_TO_2);
esc_to(3) = %char(cESC_TO_3);
esc_to(4) = %char(cESC_TO_4);
esc_to(5) = %char(cESC_TO_5);
...
isInit = cTrue;
endif;

I also have a "UNICODE" command that translates a given string from EBCDIC to UNICODE. That makes it easy to create the Unicode constants.
Let me know if you like to get a copy.

Thomas.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.