Changes between Version 2 and Version 3 of StringAPI
- Timestamp:
- 2009-05-02T12:28:20Z (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StringAPI
v2 v3 5 5 * [#CharacterRepertoire Character Repertoire and Encoding] 6 6 * [#StringMetrics String Metrics] 7 * [#PrefixFunctions Functions Operating on Prefixes] 7 8 * [#EncodingDecoding Encoding and Decoding a Character] 8 9 * [#OutputBuffers Output Buffers] … … 21 22 == String Metrics == #StringMetrics 22 23 23 * Size 24 * Length 25 * Width 24 Unlike with an 8-bit encoding, there is not a 1:1:1 mapping between bytes in memory, characters and display cells on a monospace display. Therefore, three different metrics are needed: 25 26 * ''Size'' is the number of bytes to which the string is encoded, ''excluding'' the null terminator. 27 * ''Length'' is the number of ''characters'' in the string (i.e. the number of times we need to call str_decode() or chr_encode()). Again the null terminator is not counted. 28 * ''Width'' is the number of display cells on a monospace display the string will be rendered to. 26 29 27 30 == Encoding and Decoding a Character == #EncodingDecoding … … 39 42 40 43 == Function Reference == #FunctionReference 44 45 Some functions operate on string prefixes. These have a name like `str_[n|l|w]op()`. Such a function only uses a prefix of the string limited by a metric, `n` for size, `l` for length, `w` for width. 41 46 42 47 * str_size()