You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I feel somewhat negatively about having both UTF16Encoding and UTF16Encode (because the names are too similar). Unfortunately I don't have an obviously superior name to suggest. UTF16EncodeText instead of UTF16Encoding, perhaps?
The text was updated successfully, but these errors were encountered:
To me, UTF16EncodeText suggests the semantics of UTF16Encode (i.e., it operates on text, a sequence of Unicode code points), so would be a confusing rename for UTF16Encoding.
Instead, how about renaming UTF16Encoding as UTF16EncodeCodePoint (since it operates on a single code point)?
Note that any renaming of UTF16Encoding will likely not be as simple as a search-and-replace, because there are uses of the form "the UTF16Encoding of ", which will sound odd we rename it from a noun (gerund) to a verb. (Mind you, invoking an abstract operation via that syntax is unusual to begin with, so it would be nice to make those more conventional.)
To me, UTF16EncodeText suggests the semantics of UTF16Encode (i.e., it operates on text, a sequence of Unicode code points), so would be a confusing rename for UTF16Encoding.
Sorry, I meant to suggest it as a name for UTF16Encode, yes.
Instead, how about renaming UTF16Encoding as UTF16EncodeCodePoint (since it operates on a single code point)?
Works for me. I am happy with also changing the invocation style for the operation.
In general in web browser software at least, "encode" in the context of text refers to going from code points to bytes. This isn't really what is done in these operations, which go from code points to code units.
The names I would suggest are UTF16CodePointToCodeUnits and UTF16CodePointsToCodeUnits.
Pulling this out of #1552 now that it's merged:
I feel somewhat negatively about having both
UTF16Encoding
andUTF16Encode
(because the names are too similar). Unfortunately I don't have an obviously superior name to suggest.UTF16EncodeText
instead ofUTF16Encoding
, perhaps?The text was updated successfully, but these errors were encountered: