How can I convert/export binary data (for example binary files like excel- or word-documents) into a string (into text format) in .NET, so that it can be imported somewhere else (e.g. in another application, which was written in another programming language (not in .NET)). Are there universal concepts to achieve this goal ?
views:
36answers:
1
+4
A:
The most common form is to use Base64 encoding between binary and text. .NET supports this with Convert.ToBase64String
and Convert.FromBase64String
.
Base64 is widely supported, and is a common way of encoding binary data in pure ASCII, encoding 3 bytes into 4 characters (repeatedly).
Jon Skeet
2010-06-29 14:52:40