Deutsch English
Alphabetical index
Array functions
CGI functions
Data types
Date functions
Debugging
Fulltext functions
Language elements
Numerical functions
Operators
Other functions
Ramtext functions
Selecting
Socket functions
Statistical functions
Stream functions
String functions
  • ansitooem()
  • asc()
  • chr()
  • decodeb64()
  • digitstr()
  • encodeb64()
  • exchange()
  • extnote()
  • fillstr()
  • groß()
  • isnumber()
  • klein()
  • länge()
  • leftstr()
  • length()
  • links()
  • lower()
  • ltrim()
  • makepw()
  • ntimes()
  • oemtoansi()
  • pos()
  • rechts()
  • rightstr()
  • rtrim()
  • scan()
  • soundex()
  • stradd()
  • strcomp()
  • subpath()
  • swap()
  • testln()
  • testpw()
  • tohtml()
  • upper()
  • valstr()
    System functions
    Table functions
    Text functions
    Home    Overview    Search    Impressum    Contact    Members
    Topic complex String functions
    Function encodeb64()
    Short Encodes a string with Base64
    Syntax EncodeB64(s : STRING) : STRING
    Parameter s : any string of characters from chr(0) to chr(255)
    Return Base64 coding of s
    See also:
    decodeb64()
    Description Attention: Because the Base64 encoding increases 3 bytes from the original string to 4 bytes in the destination (as printable ASCII characters) the string to be encoded must not be longer than 190 characters.

    Base64 encoding used in emails normally takes each string of 57 byte length. That leads to lines with a string length of 76 characters. Those lines are then separated by LF.

    The following procedure encodes a binary file. The result is a text file (handle t) which then could easy be send by email:

    PROCEDURE WriteB64(binary_file : STRING; t : INTEGER)
    VAR rt : STRING = 'ramtext:bin'
    VAR i, fs : INTEGER
      copyfile(binary_file,rt); fs:=getsize(rt); i:=1;
      WHILE i<=fs DO
        writeln(t,EncodeB64(ramtext_part(rt,i,57)));
        i:=i+57
      END
    ENDPROC

    User comments:
    Write a comment:
    Name
    EMail
    Subject
    Text (Switch mode)

    Choose between
    the normal and the
    advanced editor.
    The advanced editor
    runs in IE 5+ and
    Mozilla 1.4+ only
    SPAM-Protection Please enter tdbengine in this field.

    tdbengine chat
    irc.tdbengine.org
    #tdbengine

       Copyright © 2003-2004 tdb Software Service GmbH
       Alle rechte vorbehalten. / All rights reserved
       Last changed: 21.10.2004
    {Fehler für :execmacro{execmacro="sessionspy"}