After some thoughts I found why earlier versions loose the last byte from an odd length byte ansi string.
First problem was on Encoder, which use Len() and not LenB() to find the length of string. The second problem was on decoder, to feed the returned string with one byte more. The solution was to make a string as ansi, with the odd length and then copy the final bytes to that string.
New to this version, except for handling odd length byte data:
1. Compact the encoded string, means without Vbcrlf in each 60 output chars
2. Added Left Margin, so we can insert in each line some space at the left
3. Spaces and Cr/Lf can be anywhere in string to decode
4. Abnormal character stop algorithm, or ACS. When a byte to decode is not in the normal character list to decode, stop the decoding returning decoding bytes at that point. There is a flag from decoder which turn to false if no decoding can be done (which means that ACS can't apply).
5. There is a FileToEncode64() additional function to get any file as Encode64, without feeding a string before encoding
George




Reply With Quote