home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxendeco.zip / BASE64.CMD < prev    next >
OS/2 REXX Batch file  |  2001-07-15  |  953b  |  29 lines

  1. /* +------------------------------------------------------------------------+
  2.    |  encode/decode routines.            2001-07       Dave Lewis           |
  3.    +------------------------------------------------------------------------+ */
  4.  
  5. If RxFuncQuery( 'rxLoadFuncs' ) Then
  6. Do
  7.    Call RxFuncAdd 'rxLoadFuncs', 'RXAPI', 'rxLoadFuncs'
  8.    Call rxLoadFuncs
  9. End
  10.  
  11. teststring = "Try this on for size "||'0D0A'x||"Should be multi lines",
  12.              "We need a long one to see if we get a soft break "||'0D0A'x||"in the right spot.",
  13.              "It should break before 76 bytes of data.  Including the CRLF."||'0D0A'x||,
  14.              "And some special characters !@#$%^&*((*&)(*&[]{}"||'0D0A'x||, 
  15.              "."||'0D0A'x||"From : These cause problems"||'0D0A'x
  16.  
  17. encoded = rxBinToBase64( teststring )
  18.  
  19. Say encoded
  20.  
  21. Say rxBase64ToBin( encoded )
  22.  
  23. encoded = rxTxtToQuoted( teststring )
  24.  
  25. Say encoded
  26.  
  27. Say rxQuotedToTxt( encoded )
  28.  
  29.