From: James Britt Date: 2006-10-21T12:10:45+09:00 Subject: Re: rexml difficulties Harold Hausman wrote: > It sounds like you might have some experience in this area. Not to > hijack the OP, but could you possibly describe the process you would > go through if you had a completely random pile of binary barf that you > wanted to store as an XML attribute? > > Would your process include using Base64? http://www.topxml.com/xml/articles/binary/ "Base64 encoding, specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions) uses a 64-character subset (A-Za-z0-9+/) to represent binary data and = for padding. Base64 processes data as 24-bit groups, mapping this data to four encoded characters. It is sometimes referred to as 3-to-4 encoding. Each 6 bits of the 24-bit group is used as an index into a mapping table (the base64 alphabet) to obtain a character for the encoded data. According to the MIME specification the encoded data has line lengths limited to 76 characters, but this line length restriction does not apply when transmitting binary data as part of XML document." It's a common, practical approach. -- James Britt "Every object obscures another object." - Luis Bunuel