Merge pull request #659 from SamWhited/jidfixes

Daniel Gultsch created

Make sure we're storing the display JID as Unicode

Change summary

src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Detailed changes

src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java 🔗

@@ -108,11 +108,12 @@ public final class Jid {
             if (resourcepart.isEmpty() || resourcepart.length() > 1023) {
                 throw new InvalidJidException(InvalidJidException.INVALID_PART_LENGTH);
             }
-            dp = jid.substring(domainpartStart, slashLoc);
+            dp = IDN.toUnicode(jid.substring(domainpartStart, slashLoc), IDN.USE_STD3_ASCII_RULES);
             finaljid = finaljid + dp + "/" + rp;
         } else {
             resourcepart = "";
-            dp = jid.substring(domainpartStart, jid.length());
+            dp = IDN.toUnicode(jid.substring(domainpartStart, jid.length()),
+                    IDN.USE_STD3_ASCII_RULES);
             finaljid = finaljid + dp;
         }