Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.2 - Building Blocks
-
Fix Version/s: None
-
Labels:None
-
Acceptance Test - Add?:No
Description
RFC3920 does define:
Each allowable portion of a JID (node identifier, domain identifier, and resource identifier) MUST NOT be more than 1023 bytes in length, resulting in a maximum total size (including the '@' and '/' separators) of 3071 bytes.
I've seen this problem just in org.xmpp.packet.JID, line 368, "if (domain.length()*2 > 1023) {" but it may occur also somewhere else.
The right way to check the length in this case is domain.getBytes("UTF-8").length to match the requirement "1023 bytes in length".
Short sample code:
String y = "\u0001\uD11E"; // 2 System.out.println(y.length()); // 4 System.out.println(y.getBytes("UTF-8").length); // "\u20AC" String z = "€"; // 1 System.out.println(z.length()); // 3 System.out.println(z.getBytes("UTF-8").length);
reference: http://de.wikipedia.org/wiki/UTF-8 - "Beispiele für UTF-8 Kodierungen"
Any update here?
I am interested in a fix within tinder.