@@ -22,10 +22,11 @@ */ #include #include +#include #import "XMPPConnection.h" #import "XMPPStanza.h" #import "XMPPJID.h" #import "XMPPIQ.h" @@ -114,18 +115,19 @@ - (void)setServer: (OFString*)server_ { OFString *old = server; char *srv; - Stringprep_rc rc; - - if ((rc = stringprep_profile([server_ cString], &srv, - "Nameprep", 0)) != STRINGPREP_OK) - @throw [XMPPStringPrepFailedException newWithClass: isa - connection: self - profile: @"Nameprep" - string: server_]; + Idna_rc rc; + + if ((rc = idna_to_ascii_8z([server_ cString], + &srv, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS) + @throw [XMPPIDNATranslationFailedException + newWithClass: isa + connection: self + operation: @"ToASCII" + string: server_]; @try { server = [[OFString alloc] initWithCString: srv]; } @finally { free(srv);