View previous topic :: View next topic
|
Author |
Message |
Amrish Raje
New User
Joined: 21 Mar 2013 Posts: 3 Location: India
|
|
|
|
Hello, I have a requirement to send a notification email which may have unicode content. e.g. Country name like México - please note the accent over 'e'.
The country names are stored in a DB2 table in Unicode. Cobol is also equipped to handle unicode characters. I am creating an email with the Unicode message as an attachment. The email is getting generated with an *.RTF attachment. However, when I open the attachment the unicode based text becomes garbled. I have tried using every avaialble encoding option in word to open the attachmemnt but I always see garbage.
I am using IEBGENER to create email with attachment. I have tried out every possible option of content type, charset and content transfer encoding to no avail. Please help...
JCL:
//JS020 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(M,SMTP)
//*
//SYSUT1 DD DSN=xxxx.EMAIL.INITIAL,
// DISP=SHR
// DD DSN=xxxx.EMAIL.TEXT1,
// DISP=SHR
//*
xxxx.EMAIL.INITIAL contains:
HELO ADC1
MAIL FROM: <ABCD@XXXX.COM>
RCPT TO: <ABCD@XXXX.COM>
DATA
TO: <ABCD@XXXX.COM>
SUBJECT: TEST : TEST FILE
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;CHARSET=UTF-8
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;FILENAME=TEST.RTF
xxxx.EMAIL.TEXT1 contains
Hello This is Amrish
<== Line in unicode containing word "México"
I work for ABC INC |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Did you look at the file on whatever other platform you're sending it to with a hex editor?
Seems like a problem with the crapware of MacroShaft, and has abso-flucking-ly nothing to do with JCL. |
|
Back to top |
|
|
Amrish Raje
New User
Joined: 21 Mar 2013 Posts: 3 Location: India
|
|
|
|
yes, looked at the output with a hex editor. Surprisingly the attachment is in ASCII. e.g. The word "Hello" was in EBCDIC, which I was able to confim by looking at the input PS with HEX ON. Then the attachement in the email, still has the word "Hello" in a readable format. In a HEX editor, the word "Hello" is represented in ASCII. But the word "México" is also getting translated into something that is garbage... |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Clarify "garbage", in other words show us the hexadecimal representation.
FWIW, transferring just plain text to an .RTF file doesn't make it an RTF file... |
|
Back to top |
|
|
Amrish Raje
New User
Joined: 21 Mar 2013 Posts: 3 Location: India
|
|
|
|
hex representation is:
4D A9 78 69 63 6F 0D
M ?? E X I C O |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
In a HEX editor, the word "Hello" is represented in ASCII. But the word "México" is also getting translated into something that is garbage |
The timing might be difficult to get right, but when you send an email via SMTP on the mainframe, SMTP makes a copy of the message until it gets sent. The HLQ of the data sets depends upon your site standards, but the low-level qualifiers will be ADDRBLOK and NOTE for the address information and the actual SMTP text. Submit your job, then look at the NOTE to see what z/OS is actually sending. If you have trouble seeing the files on your system, send the email to a non-existent address so SMTP will keep the data around (the files are only deleted when the mail server indicates the mail has been transmitted). Contact your site support group to find out the HLQ for the data sets.
How are you creating your EMAIL.TEXT1 file? Unless it is entirely created by your COBOL program, you may have a mix of EBCDIC and UTF-8 data in the file. |
|
Back to top |
|
|
|