summaryrefslogtreecommitdiff
path: root/src/lib/utf8.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-04-15 20:27:45 -0700
committerRuss Cox <rsc@golang.org>2009-04-15 20:27:45 -0700
commit0ada410ece61f805c66b63eb15bb8584c3e584cd (patch)
tree16cfcc3cc7d82aa01da1b152e520297da5afc88a /src/lib/utf8.go
parent398d9c9582bcde24740e65cc4e5c9b97c5bcac40 (diff)
downloadgolang-0ada410ece61f805c66b63eb15bb8584c3e584cd.tar.gz
code changes for array conversion.
as a reminder, the old conversion was that you could write var arr [10]byte; var slice []byte; slice = arr; but now you have to write slice = &arr; the change eliminates an implicit &, so that the only implicit &s left are in the . operator and in string(arr). also, removed utf8.EncodeRuneToString in favor of string(rune). R=r DELTA=83 (1 added, 23 deleted, 59 changed) OCL=27531 CL=27534
Diffstat (limited to 'src/lib/utf8.go')
-rw-r--r--src/lib/utf8.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/lib/utf8.go b/src/lib/utf8.go
index 448f4819c..ff55df802 100644
--- a/src/lib/utf8.go
+++ b/src/lib/utf8.go
@@ -256,17 +256,6 @@ func EncodeRune(rune int, p []byte) int {
return 4;
}
-// EncodeRuneToString returns the UTF-8 encoding of the rune.
-func EncodeRuneToString(rune int) string {
- if rune < _Rune1Max {
- return string([1]byte{byte(rune)})
- }
-
- var buf [UTFMax]byte;
- size := EncodeRune(rune, buf);
- return string(buf[0:size]);
-}
-
// RuneCount returns the number of runes in p. Erroneous and short
// encodings are treated as single runes of width 1 byte.
func RuneCount(p []byte) int {