× 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.



Hello Thomas,

I'm interested in your code, that converts EBCDIC to Unicode and would be happy to receive a copy.

Thank you very much and best regards

Jan



Am 17.02.2017 um 22:54 schrieb Tools/400:
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.

Am 17.02.2017 um 21:24 schrieb John Allen:
I have a program that creates PDF files and emails out.

Works great here in the U.S.

QCNTRYID US

QLANGID. ENU
QCCSID . 65535

QCHRID . 00697 00037




Now I have a client in Argentina that is running there system with
Code Page 284


QCNTRYID: AR
QLANGID: ESP (24)
QCCSID: 65535
QCHRID: 697/284 - ID CHAR/CODE PAGE



PDF Specifications require a specific formatting strings
Example: [/PDF /Text]


Because Code page 284 maps differently than 37 I get an invalid PDF
format running with Code Page 284

Example: []# characters are converted to !¢Ñ

Thus resulting in invalid PDF file structure because the [] are not
there


I tested with creating the stream file with code page 1252 and 284

I tested with converting EBCDIC data to ASCII before writing it to
stream file

I tested creating the [] using Hex Values based on which code page the
job is running under

And many combinations of these


After researching, changing program testing about 50 times I am now
totally confused


This program that creates the PDF file is created and compiled on the
system in the US under code page 37

Writes stream file directly to IFS (or File Server) using unlink(),
open(), write(), close()


I need my program to check the code page of the system the program is
running on, then based on that code page

create a PDF file with the correct character mapping so that Adobe
does not crash due to incorrectly formatted data

and it displays the PDF file with the correct characters for the
corresponding country (code page)



1. When the Stream file is created initially – What Code Page should
it be created as? (1252, 37, 284 or some other)



2. Do I need to translate the EBCDIC data to ASCII in my RPG program
before writing to the stream file?
or does the operating system do the translation for me since I create
the Stream file with Code Page 284?
What code page should the ASCII table be?



3. On the System in the US I can display the file in the IFS using
WRKLNK and it displays as if it were EBCDIC
should the stream file created with the system running code 284
display the same way?



Thanks for any help you can offer


John






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.