StringToBase64 (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (printtext)
mNo edit summary
Line 16: Line 16:
<ul><li>A complete explanation of base-64 encoding can be easily found on the Internet or in many software textbooks.
<ul><li>A complete explanation of base-64 encoding can be easily found on the Internet or in many software textbooks.
<li>Base-64 encoding is useful for encoding strings that might contain binary or other characters that could cause problems in certain contexts. For example, binary characters can be problematic when sent in e-mail.<li>Base-64 encoding is an alternative to hexadecimal encoding. Hexadecimal encoding has the advantage that it's simpler, but as the disadvantage that it requires two bytes for every encoded byte. Base-64 encoding, because it uses more characters (64, as the name would suggest), only requires four bytes for every three encoded bytes.
<li>Base-64 encoding is useful for encoding strings that might contain binary or other characters that could cause problems in certain contexts. For example, binary characters can be problematic when sent in e-mail.<li>Base-64 encoding is an alternative to hexadecimal encoding. Hexadecimal encoding has the advantage that it's simpler, but as the disadvantage that it requires two bytes for every encoded byte. Base-64 encoding, because it uses more characters (64, as the name would suggest), only requires four bytes for every three encoded bytes.
<li>The <var>StringToBase64</var> function returns the standard base-64 encoding of a  string, where the encoded string is padded out to an even multiple of four bytes by appending equal signs.
<li>The <var>StringToBase64</var> function returns the standard base-64 encoding of a  string, where the encoded string is padded out to an even multiple of four bytes by appending equals signs.
<li><var>StringToBase64</var> is available as of <var class="product">[[Janus SOAP|"Janus Soap"]]</var> Version 7.2.</ul>
<li><var>StringToBase64</var> is available as of <var class="product">[[Janus SOAP|"Janus Soap"]]</var> Version 7.2.</ul>



Revision as of 22:34, 28 February 2011

Convert an Ebcdic string to base 64 (String class)


The StringToBase64 intrinsic function returns the base-64 encoded value of the method object string.

Syntax

%outString = string:StringToBase64

Syntax terms

%outString A string variable to receive the base-64 encoded value of the method object string.
string The string to be base-64 encoded.

Usage notes

  • A complete explanation of base-64 encoding can be easily found on the Internet or in many software textbooks.
  • Base-64 encoding is useful for encoding strings that might contain binary or other characters that could cause problems in certain contexts. For example, binary characters can be problematic when sent in e-mail.
  • Base-64 encoding is an alternative to hexadecimal encoding. Hexadecimal encoding has the advantage that it's simpler, but as the disadvantage that it requires two bytes for every encoded byte. Base-64 encoding, because it uses more characters (64, as the name would suggest), only requires four bytes for every three encoded bytes.
  • The StringToBase64 function returns the standard base-64 encoding of a string, where the encoded string is padded out to an even multiple of four bytes by appending equals signs.
  • StringToBase64 is available as of "Janus Soap" Version 7.2.

Examples

  1. The following statement displays 8PHy8/T19vf4+Q==:

    printText {'0123456789':stringTobase64}

See also