[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting back and printing a base64 encoded Zebra label...



All,

I'm helping another developer with a project that using HTTPAPI to
send a request to a transportation management company.  The response
back is supposed to include a encoded printer stream for a Zebra label
printer...

The data element of the response starts out
<data>PExvZ3M+PExvZyAgdGltZXN0YW1wPSIwNC

Assuming the data was base64 encoded, I copied and pasted it into an
online converter and got back...
<Logs><Log  timestamp="04/25/2012 13:45:03"><Owner></Owner>
<UserId></UserId>
<Process>< ½Aɽ?•ÍÌø(ñ Ù•¹Ðù1=ð½ Ù•¹Ðø(ñ?Ñ¥½¸ù

So it appears that my assumption was correct about the base64...but we
weren't expecting more XML...nor what appears to be binary data...I
was expecting text based ZPL.

Waiting to hear back from the TM company....

In the meantime, I'm trying to wrap my head around the the
implications of ASCII, EBCDIC, binary and possibly UTF :)

Scott mentions his BASE64 expects EBCDIC...
http://www.scottklement.com/archives/ftpapi/201007/msg00020.html

But that the base64 routines in the Apache Portable Runtime in the OS
if using the encode text routine, automatically translate from EBCDIC
to ASCII...
http://www.iprodeveloper.com/article/application-development/base64-is-built-in-to-ibm-i-63967

The HTTP protocol uses ASCII (or UTF I guess)
But the XML data returned to my procedure by http_url_post_xml has
been translated into EBCDIC, right?
I assume the base64 data was encoded from ASCII, but given the above
the encoded data would have been translated by HTTPAPI into EBCDIC..

Do I need to translate it back to ASCII before decoding it?

Or does it matter given that the invariant character set is used by
base64 encoding right?

Assuming the decoded data contains a binary data stream, can I just
store it in an RPG variable coded with CCSID(65535)?
Or if it's an ASCII stream, store it with CCSDI(???) (need to look that up :).

What's the best way to get it to a Zebra printer...
I was expecting to be able to use a PRTF defined as *USERASCII.... but
if it's binary data would that still work?


Thanks!
Charles
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------