]> Cypherpunks repositories - gostls13.git/commit
exp/norm: added Reader and Writer and bug fixes to support these.
authorMarcel van Lohuizen <mpvl@golang.org>
Fri, 2 Sep 2011 10:39:35 +0000 (12:39 +0200)
committerMarcel van Lohuizen <mpvl@golang.org>
Fri, 2 Sep 2011 10:39:35 +0000 (12:39 +0200)
commit25171439578dd08c8bc98bd3fbacada98c9c7e28
treebe57d2b7a22692a485f4e37da65387398d541676
parentb349cd2b0ad12c2ebe67ca2c6c1aa01bc9991520
exp/norm: added Reader and Writer and bug fixes to support these.
Needed to ensure that finding the last boundary does not result in O(n^2)-like behavior.
Now prevents lookbacks beyond 31 characters across the board (starter + 30 non-starters).
composition.go:
- maxCombiningCharacters now means exactly that.
- Bug fix.
- Small performance improvement/ made code consistent with other code.
forminfo.go:
- Bug fix: ccc needs to be 0 for inert runes.
normalize.go:
- A few bug fixes.
- Limit the amount of combining characters considered in FirstBoundary.
- Ditto for LastBoundary.
- Changed semantics of LastBoundary to not consider trailing illegal runes a boundary
  as long as adding bytes might still make them legal.
trie.go:
- As utf8.UTFMax is 4, we should treat UTF-8 encodings of size 5 or greater as illegal.
  This has no impact on the normalization process, but it prevents buffer overflows
  where we expect at most UTFMax bytes.

R=r
CC=golang-dev
https://golang.org/cl/4963041
src/pkg/exp/norm/Makefile
src/pkg/exp/norm/composition.go
src/pkg/exp/norm/forminfo.go
src/pkg/exp/norm/normalize.go
src/pkg/exp/norm/normalize_test.go
src/pkg/exp/norm/readwriter.go [new file with mode: 0644]
src/pkg/exp/norm/readwriter_test.go [new file with mode: 0644]
src/pkg/exp/norm/trie.go
src/pkg/exp/norm/trie_test.go