Skip to content

Base64 encoding in I/O statements #330

Open
@ivan-pi

Description

@ivan-pi

Popular visualization formats like the VTK XML File Format use Base64 encoding of numerical data as text. This slightly increases the amount of storage, but proves to be more reliable when distributing data via channels that predominantly support text (e.g. the internet). Another example use case would be embedding binary data (e.g. images, other binary assets) in HTML reports generated by a Fortran program.

The idea was suggested here:

As the user "rwmsu" has stated in that thread:

This would be a big help for writing things like the VTK XML format files where you want to mix base64 encoded binary with standard text. I presume it would have to be an option on the read and/or write statement. something like

Write(iunit, *) ‘’
Write(iunit, *, ENCODE=“base64”) some_real_array

etc.

Having that capability in a compiler would have saved me the time and the almost 1000 lines of code it took to develop my own base64 encoding/decoding package.

Right now, available libraries for Base64 encoding include:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions