commit | b17614b6264763f3eeee6943b7d2dc40570f211d | [log] [tgz] |
---|---|---|
author | Connor Lane Smith <cls@lubutu.com> | Mon Oct 24 19:17:59 2016 |
committer | Connor Lane Smith <cls@lubutu.com> | Mon Oct 24 19:19:58 2016 |
tree | 08751896089c726fddf5c152405c497d0ac39e06 | |
parent | 60a0b755e5383d4f615f5f7a39b1629515105b0c [diff] |
add .gitattributes for C header files
This is a C89 UTF-8 library, with an API compatible with that of Plan 9's libutf, but with a number of improvements:
utflen
and utfnlen
cannot overflow on 32- or 64-bit machines.chartorune
treats all invalid codepoints as though Runeerror
.fullrune
, utfecpy
, and utfnlen
do not overestimate the length of malformed runes.charntorune(p,s,n)
, equivalent to fullrune(s,n) ? chartorune(p,s) : 0
.Runeerror
may be set to an alternative replacement value, such as -1, to be used instead of U+FFFD.Differences to be aware of:
UTFmax
is 6, though runetochar
will never write more than 4 bytes. Plan 9's UTFmax
is 3.chartorune
may consume multiple bytes for each illegal rune. Plan 9 always consumes 1.runelen
and runetochar
return 0 if the rune is too large to print. Plan 9 erroneously returns UTFmax
.