From bd189318ed161b05f601c07262aca5d9cbcb6294 Mon Sep 17 00:00:00 2001 From: Andrew Tunnell-Jones Date: Sun, 2 Mar 2014 10:38:46 +0000 Subject: [PATCH] Document domain name and TXT escaping behaviour --- dns.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dns.go b/dns.go index 88d6f9cb..d1aadae6 100644 --- a/dns.go +++ b/dns.go @@ -83,6 +83,20 @@ // if t, ok := in.Answer[0].(*dns.TXT); ok { // // do something with t.Txt // } +// +// Domain Name and TXT Character String Representations +// +// Both domain names and TXT character strings are converted to presentation +// form both when unpacked and when converted to strings. +// +// For TXT character strings, tabs, carriage returns and line feeds will be +// converted to \t, \r and \n respectively. Back slashes and quotations marks +// will be escaped. Bytes below 32 and above 127 will be converted to \DDD +// form. +// +// For domain names, in addition to the above rules brackets, periods, +// spaces, semicolons and the at symbol are escaped. +// package dns import (