Added support for stringprep, as required by the RFC.
authorChris Jones <chris@cjones.org>
Mon, 23 Jan 2012 21:54:41 -0700
changeset 88 d2ec96c80efe
parent 72 53f15893a1a7
child 89 241024dbdba3
child 98 c9cc4eda6dce
Added support for stringprep, as required by the RFC.
structs.go
--- a/structs.go	Mon Jan 16 20:30:29 2012 -0600
+++ b/structs.go	Mon Jan 23 21:54:41 2012 -0700
@@ -10,6 +10,7 @@
 	"bytes"
 	"flag"
 	"fmt"
+	"go-idn.googlecode.com/hg/src/stringprep"
 	"io"
 	"os"
 	"regexp"
@@ -201,9 +202,9 @@
 	if parts == nil {
 		return false
 	}
-	jid.Node = parts[2]
-	jid.Domain = parts[3]
-	jid.Resource = parts[5]
+	jid.Node = stringprep.Nodeprep(parts[2])
+	jid.Domain = stringprep.Nodeprep(parts[3])
+	jid.Resource = stringprep.Resourceprep(parts[5])
 	return true
 }