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



You need to find out (as Scott said) what the original code point of the data is. Until you have that anything else is a waste of time.

For example - if the code point for the data were the same as the device to which it will be sent then a blob would be the best storage vehicle because the best fit is the straight binary representation.

Do you _have_ to write it to the IFS as opposed to sending it direct to the device? If it has to go to the IFS then the file needs to be the same code point as the original data.

Focus on minimizing the transforms - as others have pointed out Base64 is just a way of safely representing what is effectively a binary stream.



On Aug 11, 2020, at 3:41 PM, Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

Thanks for the explanation.

So when I decode the Base64 into an RPG variable, do I need to assign the correct CCSID to that RPG Variable (I would assume yes)?

When I use the IFS APIs to write this to a file on the IFS, I would assume I need to OPEN() the file with the same CCSID, correct?

That's where I'm having a bit of trouble. One of the data strings contained the "trademark" symbol (TM). Since I'm doing nothing with CCSIDs (i.e. using 37), it seems to translate that to x'99'. When I send that to the Zebra printer, it simply doesn't print (which is OK).

I just want to avoid any kind of conversion errors.

Thanks,
Greg

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Patrik Schindler
Sent: Tuesday, August 11, 2020 2:29 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Base64 decode

Hello Vernon & Greg,

Am 11.08.2020 um 18:49 schrieb Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>:

Base64 takes any byte-sequence and takes 6 bits of it at a time and uses that number as an index into a table of 64 (2*6) ASCII characters, comprising upper and lower case letters, the 10 digits, and a couple puncutation - 000000 -> A, for example.

Using this, it is possible to send binary data to any system - it does take 4 Base64 characters for every 3 bytes.

Or, explained more easily: Mangle binary data so it is represented by text (not actual language) contained within the original ASCII character set, to to be transferred to any ASCII capable system without loss of data because of different charsets, or even non 8-bit clean links. A leftover from ancient times, then called uuencode (and having a slightly different method).

Recommended reading:

https://en.wikipedia.org/wiki/Base64

https://en.wikipedia.org/wiki/Uuencoding

https://en.wikipedia.org/wiki/YEnc

:wq! PoC

PGP-Key: DDD3 4ABF 6413 38DE - https://www.pocnet.net/poc-key.asc

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


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.