Internationalization and localization tools


ANSI Encryption Function

char *l64a(long int n);

long int a64l(const char *string);

Internationalization (I18n) Function Overview

The l64a function encodes a 32-bit input value using characters from the basic character set. It returns a pointer to a 6 character buffer which contains an encoded version of n. To encode a series of bytes the user must copy the returned string to a destination buffer. It returns the empty string if n is zero, which is somewhat bizarre but mandated by the standard. To encode a large buffer, l64a must be called in a loop, once for each 32-bit word of the buffer.

To decode data produced with l64a, the a64l function should be used. The parameter string should contain a string which was produced by a call to l64a. The function processes at least 6 characters of this string, and decodes the characters it finds. If you have a buffer which has been broken into lines, you must be careful to skip over the end-of-line characters.

To store or transfer binary data in environments which only support text one has to encode the binary data by mapping the input bytes to characters in the range allowed for storing or transfering. That is the purpose of these functions. Note however that these functions are not standard. There are some other encoding methods which are much more widely used (UU encoding, MIME encoding). Generally, it is better to use one of these encodings.

I18n Issues

These functions are designed to work specifically with 8-bit character data. Therefore, the data for these functions should be left as char and not promoted to wchar_t if migrating to a wide character application.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

ANSI Encryption Functions

 

Lingoport internationalization and localization services and software