Closed aphillips closed 2 years ago
[from Addison]
Section 4.7 describes character escapes. This issue asked for examples of common escaping mechanisms. I added a table that looks like the screenshot below
I think it would be better to move the JavaScript ES6 escape row above the JavaScript (UTF-16) row.
Can you explain your thinking here? Should I also move the \x
one up so that the \[ux]{1234}
encodings are together and the \[uU]
encodings are together? Note that the fixed width \u
encoding is more common (I think) than the \u{a}
encoding
Main reason for the suggested move is that JS is often used with HTML, so maybe better to have them together and near the top. But also, i'd like to subtely suggest that using real code point values rather than surrogate code point values should be the preferred approach.
But now you made me think about it some more, i'm wondering whether perhaps we should effectively swap the 1st and 2nd column positions... ie. you could have (linearised here because this is markdown):
etc
I like the idea, but it was somewhat complicated. Some escaping schemes (\u
) are used by a bunch of languages; a few of these also use \U
. Some provide for the delimited variety. It's complicated. I did break out fixed-vs-variable and tried to clarify. I'm not sure my effort was an improvement :-)
What do you think?
Hmm. Sorry, but i find that too cluttered and complicated. Note that i was suggesting making Application col 1, and Type as col 2, but this seems to be further away from the simplification that that would afford. I don't think we need to define how each escape works; i just saw this as a table of examples. Therefore, i think the Width column is not needed. I also think it's better to have the Example col right next to the Description col, since it makes it easier to compare both.
I'm frustrated that i can't quickly code up something to show you because markdown won't allow me and i can't find the source code you've been working with. If you send me the code for the table in email, i could show you what i mean.
So sorry about that, but for me your changes made things worse rather than better :-(
I agree. I understood what your suggestion was, but it was hard to make it work. Putting the application on the left meant either repeating some of the escapes or repeating the "application" column. How about this:
(Under separate cover sending you the table)
I think that's much better! :-) Two nitty suggestions:
(ECMAScript 6 and later)
– these are just examples, and it prevents JavaScript
looking like a titleDelimited \u
to \u delimited
, or \u....
; same for \xoh and perhaps:
Java
to UTF-16 code units
http://w3c.github.io/bp-i18n-specdev/#char_escapes
there are only a few escaping mechanisms in wide use. having a table showing them and showing where they are used would be friendly to users.