rearrange some constants. unicode package now defines MaxRune and ReplacementChar.
utf8 package imports unicode to get those definitions.
regenerate dependencies.
R=rsc
DELTA=41 (19 added, 3 deleted, 19 changed)
OCL=34123
CL=34129
diff --git a/src/pkg/utf8/utf8.go b/src/pkg/utf8/utf8.go
index 9c2ac79..62adcd9 100644
--- a/src/pkg/utf8/utf8.go
+++ b/src/pkg/utf8/utf8.go
@@ -6,11 +6,12 @@
// This package calls a Unicode character a rune for brevity.
package utf8
+import "unicode" // only needed for a couple of constants
+
// Numbers fundamental to the encoding.
const (
- RuneError = 0xFFFD; // the "error" Rune or "replacement character".
+ RuneError = unicode.ReplacementChar; // the "error" Rune or "replacement character".
RuneSelf = 0x80; // characters below Runeself are represented as themselves in a single byte.
- RuneMax = 0x10FFFF; // maximum Unicode code point.
UTFMax = 4; // maximum number of bytes of a UTF-8 encoded Unicode character.
)
@@ -239,7 +240,7 @@
return 2;
}
- if rune > RuneMax {
+ if rune > unicode.MaxRune {
rune = RuneError
}