diff options
Diffstat (limited to 'src/pkg/utf8/utf8.go')
| -rw-r--r-- | src/pkg/utf8/utf8.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/utf8/utf8.go b/src/pkg/utf8/utf8.go index 62adcd9e0..2604c5541 100644 --- a/src/pkg/utf8/utf8.go +++ b/src/pkg/utf8/utf8.go @@ -290,3 +290,9 @@ func RuneCountInString(s string) int { return n; } +// RuneStart reports whether the byte could be the first byte of +// an encoded rune. Second and subsequent bytes always have the top +// two bits set to 10. +func RuneStart(b byte) bool { + return b & 0xC0 != 0x80 +} |
