@@ -100,11 +100,13 @@ if (dn_expand(ns_msg_base(handle), ns_msg_end(handle), (uint8_t*)&rdata[3], buffer, NS_MAXDNAME) < 1) @throw [OFInitializationFailedException newWithClass: isa]; - target = [[OFString alloc] initWithCString: buffer]; + target = [[OFString alloc] + initWithCString: buffer + encoding: OF_STRING_ENCODING_NATIVE]; } @catch (id e) { [self release]; @throw e; } @@ -211,12 +213,13 @@ newWithClass: isa socket: nil host: domain]; answer = [self allocMemoryWithSize: of_pagesize]; - answerLen = res_nsearch(&resState, [request cString], ns_c_in, - ns_t_srv, answer, (int)of_pagesize); + answerLen = res_nsearch(&resState, [request cStringWithEncoding: + OF_STRING_ENCODING_NATIVE], ns_c_in, ns_t_srv, answer, + (int)of_pagesize); if ((answerLen == -1) && ((h_errno == HOST_NOT_FOUND) || (h_errno == NO_DATA))) return;