aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string.c
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-07-07 14:07:46 -0700
committerRob Pike <r@golang.org>2008-07-07 14:07:46 -0700
commit5b904a3bdee22529d4f6c42aa83c98c5d895eadb (patch)
treebc77d683442d0f051be4f2a98d3456297c9f2411 /src/runtime/string.c
parent0d079a5362e1517ab178c8cd792eeb1394f8cccb (diff)
downloadgo-5b904a3bdee22529d4f6c42aa83c98c5d895eadb.tar.xz
update to Unicode 5
SVN=126184
Diffstat (limited to 'src/runtime/string.c')
-rw-r--r--src/runtime/string.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/runtime/string.c b/src/runtime/string.c
index 9bac09184d..d21273de0e 100644
--- a/src/runtime/string.c
+++ b/src/runtime/string.c
@@ -151,55 +151,6 @@ sys·indexstring(string s, int32 i, byte b)
FLUSH(&b);
}
-/*
- * this is the plan9 runetochar
- * extended for 36 bits in 7 bytes
- * note that it truncates to 32 bits
- * through the argument passing.
- */
-static int32
-runetochar(byte *str, uint32 c)
-{
- int32 i, n;
- uint32 mask, mark;
-
- /*
- * one character in 7 bits
- */
- if(c <= 0x07FUL) {
- str[0] = c;
- return 1;
- }
-
- /*
- * every new character picks up 5 bits
- * one less in the first byte and
- * six more in an extension byte
- */
- mask = 0x7ffUL;
- mark = 0xC0UL;
- for(n=1;; n++) {
- if(c <= mask)
- break;
- mask = (mask<<5) | 0x1fUL;
- mark = (mark>>1) | 0x80UL;
- }
-
- /*
- * lay down the bytes backwards
- * n is the number of extension bytes
- * mask is the max codepoint
- * mark is the zeroth byte indicator
- */
- for(i=n; i>0; i--) {
- str[i] = 0x80UL | (c&0x3fUL);
- c >>= 6;
- }
-
- str[0] = mark|c;
- return n+1;
-}
-
void
sys·intstring(int64 v, string s)
{