@@ -611,10 +611,18 @@ characters permitted in user ID localparts. There are currently active
611
611
users whose user IDs do not conform to the permitted character set, and
612
612
a number of rooms whose history includes events with a ` sender ` which
613
613
does not conform. In order to handle these rooms successfully, clients
614
- and servers MUST accept user IDs with localparts from the expanded
615
- character set:
614
+ and servers MUST accept user IDs with localparts consisting of any legal
615
+ non-surrogate Unicode code points except for ` : ` and ` NUL ` (U+0000), including other control
616
+ characters and the empty string.
616
617
617
- extended_user_id_char = %x21-39 / %x3B-7E ; all ASCII printing chars except :
618
+ User IDs with localparts containing characters outside the range U+0021 to U+007E, or with
619
+ an empty localpart, are considered non-compliant. For current room versions, servers must
620
+ still accept events using such user IDs over federation; however they SHOULD NOT forward
621
+ such user IDs to clients when referenced outside the context of an event. For example,
622
+ device list updates from non-compliant user IDs would be dropped by the receiving server.
623
+
624
+ A future room version may prevent users using a historical character set
625
+ from participating. Use of the historical character set is * deprecated* .
618
626
619
627
##### Mapping from other character sets
620
628
@@ -663,6 +671,11 @@ Room IDs are case-sensitive. They are not meant to be
663
671
human-readable. They are intended to be treated as fully opaque strings
664
672
by clients.
665
673
674
+ The localpart of a room ID (` opaque_id ` above) may contain any valid
675
+ non-surrogate Unicode code points, including control characters, except ` : ` and ` NUL `
676
+ (U+0000), but it is recommended to only include ASCII letters and
677
+ digits (` A-Z ` , ` a-z ` , ` 0-9 ` ) when generating them.
678
+
666
679
The length of a room ID, including the ` ! ` sigil and the domain, MUST
667
680
NOT exceed 255 bytes.
668
681
@@ -676,6 +689,9 @@ The `domain` of a room alias is the [server name](#server-name) of the
676
689
homeserver which created the alias. Other servers may contact this
677
690
homeserver to look up the alias.
678
691
692
+ The localpart of a room alias may contain any valid non-surrogate Unicode codepoints
693
+ except ` : ` and ` NUL ` .
694
+
679
695
The length of a room alias, including the ` # ` sigil and the domain, MUST
680
696
NOT exceed 255 bytes.
681
697
0 commit comments