Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

another fix for the punycode parser/generator (should work now!)

orbiter6779b455d75f
diff --git a/source/de/anomic/yacy/yacyURL.java b/source/de/anomic/yacy/yacyURL.java
index a63de8dd8..86cb5ed4d 100644
--- a/source/de/anomic/yacy/yacyURL.java
+++ b/source/de/anomic/yacy/yacyURL.java
@@ -470,10 +470,10 @@ public class yacyURL {
int d1 = host.lastIndexOf('.');
if (d1 >= 0) {
String tld = host.substring(d1 + 1);
- String dom = host.substring(0, d1 - 1);
+ String dom = host.substring(0, d1);
int d0 = dom.lastIndexOf('.');
if (d0 >= 0) {
- host = dom.substring(0, d0) + ".xn--" + Punycode.encode(dom.substring(d0)) + "." + tld;
+ host = dom.substring(0, d0) + ".xn--" + Punycode.encode(dom.substring(d0 + 1)) + "." + tld;
} else {
host = "xn--" + Punycode.encode(dom) + "." + tld;
}