I want to encode an icon in order to store it in a XML file , I have many Base64 encoder but the problem is that I want to know how to encode an icon.

I thought that I should open it for binary & send the retrieved string to my encoders but opening icons for binary always give me error 62 past end of file , I made a search here & I found topics marked as resolved about this but all methods in it either fail or give my the same error , so any ideas about how to do this , thanks.