in reply to Jargon relating to Perl strings
The sequence of string elements in a string. This is not affected by the string's UTF8 flag.This is not what you want to say (it immediately confused me because my first thought was, "This is wrong because if you have a string with non-ASCII characters in it and change its UTF8 flag, that will change the sequence of elements.")
What I think you meant to say
The sequence of string elements in a string, irrespective of any particular choice of memory representation being used for that stringand only bring up the UTF8 flag later.
Also, IMHO there needs to be distinct terminology for
- a grouping of (usually but not always) 8 consecutive bits of physical storage
- the abstract array element in the case where all elements are expected to be in the range 0-255, regardless of the actual storage format
One could possibly commandeer "octet" for (2) but realize that "octet" originated in the RFC world where a word was needed to refer to physical storage in the specific case where bytes explicitly are known to be 8 bits. On the other hand, most of the stuff in the RFC world is indeed trying to abstract away from specific hardware, so one could justify its usage in a more abstract sense that way. And "octet" does, at least, immediately imply 0-255, unlike "byte"
There's also the small matter that it really doesn't make a whole lot of sense to use UTF-8-flag-on format to store something that is composed of octets, even if it is indeed possible to do. Which is why people conflate octet strings with the UTF-8-flag-off format and its 1-1 correspondence between octets and bytes
(...and thus why it is indeed important to point out that UTF-8-flag-on octet strings are possible, albeit silly...)
Update: yeah I edited this... sorry.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Jargon relating to Perl strings
by ikegami (Patriarch) on Jan 18, 2012 at 02:22 UTC | |
by wrog (Friar) on Jan 20, 2012 at 02:51 UTC | |
by ikegami (Patriarch) on Jan 20, 2012 at 05:42 UTC |