Is there a way to convert an icon file to a text string and vice versa?

I mean... I know that the save files technically do it, and I remember ages ago you used to be able to convert save files to txt files and view the contents, including the icon file which was a long block of random characters.

Is there an actual function to do that though?

I want to be able to convert an icon to a text string and also do the reverse. Is there any way to actually do that?
U need a mirror list with text and params
Icon to text?