[erlang-questions] mime_decode_string/1?

Kenneth Lundin <>
Tue May 6 08:09:01 CEST 2008


Hi,

Yes it is an error in the documentation of the base64 module.

There is no function called mime_decode_string/1, it should be
mime_decode_to_string/1 instead.

Thanks for pointing out this error, it will be fixed in the R12B-3 release.

/Kenneth Erlang/OTP, Ericsson

On 5/6/08, Catsunny <> wrote:
> Hi,
> I wonder if there is something wrong in the erlang documentation->STDLIB
> Reference->base64? The documentation says:
>
> base64
> MODULE
> base64
> MODULE SUMMARY
> Implements base 64 encode and decode, see RFC2045.
> DESCRIPTION
> Implements base 64 encode and decode, see RFC2045.
>
> EXPORTS
> encode(Data) -> Base64
> encode_to_string(Data) -> Base64String
>
>
> Types:
>
> Data = string() | binary()
> Base64 = binary()
> Base64String = string()
>
>
> Encodes a plain ASCII string into base64. The result will be 33% larger
> than the data.
>
> decode(Base64) -> Data
> decode_to_string(Base64) -> DataString
> mime_decode(Base64) -> Data
> mime_decode_string(Base64) -> DataString
>
>
> Types:
>
> Base64 = string() | binary()
> Data = binary()
> DataString = string()
>
>
> Decodes a base64 encoded string to plain ASCII. The string should only
> consist of characters in the base64 set, see RFC4648. mime_decode/1 and
> mime_decode_to_string/1 strips away illegal characters, while decode/1 and
> decode_to_string/1 fails if an illegal charactrer is found.
>
>
> --------------------------------------------------------------------------------
> stdlib 1.15.1
> Copyright ? 1991-2008 Ericsson AB
>
> All the functions is ok except the last one, mime_decode_string/1:
> 11> base64:mime_decode_string(base64:encode_to_string("我们")).
> ** exception error: undefined function base64:mime_decode_string/1.
> Is this an error in the library reference manual?
>
> Thank you!
> catsunny
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions


More information about the erlang-questions mailing list