<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I just read the following from&nbsp;<span class="Apple-tab-span" style="white-space: pre; "><a href="http://www.zeroconf.org/Rendezvous/txtrecords.html">http://www.zeroconf.org/Rendezvous/txtrecords.html</a></span>&nbsp;which states that while it is a TXT record, the NAME is ASCII, but the VALUE is 8 bit binary and you SHOULD NOT convert binary values into hexadecimal ascii!</div><div><span class="Apple-tab-span" style="white-space: pre; "><br></span></div><div><span class="Apple-tab-span" style="white-space: pre; ">W</span>hat is the best way to encode binary values in a TXT record as defined by the xml service file in avahi?&nbsp;</div><div><br></div><div>Does avahi handle embedded nulls in the value?</div><div><span class="Apple-tab-span" style="white-space: pre; "><br></span></div><div><span class="Apple-tab-span" style="white-space: pre; ">R</span>egards,</div><div>Jeff Koftinoff</div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><span class="Apple-tab-span" style="white-space: pre; "><h2 style="font-family: 'Helvetica Neue'; white-space: normal; "><a name="values">Rules for values in DNS-SD Name/Value pairs</a></h2></span></div><div><span class="Apple-tab-span" style="white-space: pre; "><p style="font-family: 'Helvetica Neue'; white-space: normal; ">If there is an '=', then everything after the first '=' to the end of the string is the value. The value can contain any eight-bit values&nbsp;<i>including</i>&nbsp;'='. Leading or trailing spaces are part of the value, so don't put them there unless you intend them to be there. Any quotation marks around the value are part of the value, so don't put them there unless you intend them to be part of the value.</p></span></div><div><span class="Apple-tab-span" style="white-space: pre; "><p style="font-family: 'Helvetica Neue'; white-space: normal; ">The value is opaque binary data. Often the value for a particular attribute will be US-ASCII (or UTF-8) text, but it is legal for a value to be any binary data. For example, if the value of a key is an IPv4 address, that address should simply be stored as four bytes of binary data, not as a variable-length 7-15 byte ASCII string giving the address represented in textual dotted decimal notation.</p></span></div><div><span class="Apple-tab-span" style="white-space: pre; "><p style="font-family: 'Helvetica Neue'; white-space: normal; ">Generic debugging tools should generally display all attribute values as if they were UTF-8 text, except for attributes where the debugging tool has embedded knowledge that the value is some other kind of data.</p></span></div><div><span class="Apple-tab-span" style="white-space: pre; "><p style="font-family: 'Helvetica Neue'; white-space: normal; ">Authors defining DNS-SD (Rendezvous) profiles SHOULD NOT convert binary attribute data types into printable text (e.g. using hexadecimal, Base64 or UU encoding) merely for the sake of making the data be printable text when seen in a generic debugging tool. Doing this simply bloats the size of the TXT record, without truly making the data any more understandable to someone looking at it in a generic debugging tool.</p></span></div></blockquote></body></html>