Clarification on allowed characters in member names


#1

The spec defines the allowed and reserved characters in the member names.

The “Allowed Characters” and “Reserved Characters” appear to me have some redundancy :

The following “globally allowed characters” MAY be used anywhere in a member name:
[…]
any UNICODE character except U+0000 to U+007F (not recommended, not URL safe)

and the “Reserved Characters” (“MUST NOT be used”) list which contains only characters from the “U+0000 to U+007F” characters.

Is there something I don’t take into consideration ?

Thanks


#2

Hi @yves. Thanks for catching this!

I believe that where the spec says “except” in the clause that you quote, it should say “outside the range”.

So, in other words, the characters above U+007F are allowed (but not recommended), while the characters from U+0000 to U+007F are sometimes allowed and sometimes not (as per the rest of the rules in that section).

Does that make sense?


#3

Thanks @ethanresnick for your answer, your rewording helps me.

The range “U+0000 to U+007F” confused me because it overlaps with other ranges of allowed, unallowed and not recommended characters. It isn’t clear to know exactly what is allowed or not without to take the “Reserved Characters” one by one.
I think something like that would be more verbose but more obvious (changes in bold characters) :

Allowed Characters

The following “globally allowed characters” MAY be used anywhere in a member name:

  • U+0061 to U+007A, “a-z”
  • U+0041 to U+005A, “A-Z”
  • U+0030 to U+0039, “0-9”
  • U+0080 and above (not recommended, not URL safe)

Additionally, the following characters are allowed in member names, except as the
first or last character:

  • U+002D HYPHEN-MINUS, “-”
  • U+005F LOW LINE, “_”
  • U+0020 SPACE, " " (not recommended, not URL safe)

The following characters MUST NOT be used in member names:

  • U+0000 to U+001F, Control Characters
  • U+007F DELETE

Reserved Characters

[the same here…]

If I’m not doing mistake, all the characters of the U+0000 to U+007F are explicitly specified in this version.
What do you think of this proposal ?


#4

I’m ok with a change like this, and have submitted a PR.


#5

Thanks @ethanresnick for your great work !