Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 85 for appendRune (0.21 sec)

  1. src/unicode/utf16/utf16_test.go

    		}
    	}
    }
    
    func TestAppendRune(t *testing.T) {
    	for _, tt := range encodeTests {
    		var out []uint16
    		for _, u := range tt.in {
    			out = AppendRune(out, u)
    		}
    		if !reflect.DeepEqual(out, tt.out) {
    			t.Errorf("AppendRune(%x) = %x; want %x", tt.in, out, tt.out)
    		}
    	}
    }
    
    func TestEncodeRune(t *testing.T) {
    	for i, tt := range encodeTests {
    		j := 0
    		for _, r := range tt.in {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  2. src/syscall/wtf8_windows.go

    			i++
    		default:
    			// WTF-8 fallback.
    			// This only handles the 3-byte case of utf8.AppendRune,
    			// as surrogates always fall in that case.
    			ar = rune(r)
    			if ar > utf8.MaxRune {
    				ar = utf8.RuneError
    			}
    			buf = append(buf, t3|byte(ar>>12), tx|byte(ar>>6)&maskx, tx|byte(ar)&maskx)
    			continue
    		}
    		buf = utf8.AppendRune(buf, ar)
    	}
    	return buf
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 15 09:26:16 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  3. src/vendor/golang.org/x/text/unicode/norm/composition.go

    func (rb *reorderBuffer) decomposeHangul(r rune) {
    	r -= hangulBase
    	x := r % jamoTCount
    	r /= jamoTCount
    	rb.appendRune(jamoLBase + r/jamoVCount)
    	rb.appendRune(jamoVBase + r%jamoVCount)
    	if x != 0 {
    		rb.appendRune(jamoTBase + x)
    	}
    }
    
    // combineHangul algorithmically combines Jamo character components into Hangul.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 19:27:51 UTC 2019
    - 14.1K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/text/unicode/norm/composition.go

    func (rb *reorderBuffer) decomposeHangul(r rune) {
    	r -= hangulBase
    	x := r % jamoTCount
    	r /= jamoTCount
    	rb.appendRune(jamoLBase + r/jamoVCount)
    	rb.appendRune(jamoVBase + r%jamoVCount)
    	if x != 0 {
    		rb.appendRune(jamoTBase + x)
    	}
    }
    
    // combineHangul algorithmically combines Jamo character components into Hangul.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  5. src/unicode/utf8/example_test.go

    	fmt.Println(utf8.ValidString(valid))
    	fmt.Println(utf8.ValidString(invalid))
    	// Output:
    	// true
    	// false
    }
    
    func ExampleAppendRune() {
    	buf1 := utf8.AppendRune(nil, 0x10000)
    	buf2 := utf8.AppendRune([]byte("init"), 0x10000)
    	fmt.Println(string(buf1))
    	fmt.Println(string(buf2))
    	// Output:
    	// ๐€€
    	// init๐€€
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 05 21:29:18 UTC 2021
    - 3.6K bytes
    - Viewed (0)
  6. src/unicode/utf8/utf8_test.go

    		}
    	}
    }
    
    func TestAppendRune(t *testing.T) {
    	for _, m := range utf8map {
    		if buf := AppendRune(nil, m.r); string(buf) != m.str {
    			t.Errorf("AppendRune(nil, %#04x) = %s, want %s", m.r, buf, m.str)
    		}
    		if buf := AppendRune([]byte("init"), m.r); string(buf) != "init"+m.str {
    			t.Errorf("AppendRune(init, %#04x) = %s, want %s", m.r, buf, "init"+m.str)
    		}
    	}
    }
    
    func TestDecodeRune(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 06:17:15 UTC 2022
    - 16.2K bytes
    - Viewed (0)
  7. src/encoding/json/fold.go

    			if 'a' <= c && c <= 'z' {
    				c -= 'a' - 'A'
    			}
    			out = append(out, c)
    			i++
    			continue
    		}
    		// Handle multi-byte Unicode.
    		r, n := utf8.DecodeRune(in[i:])
    		out = utf8.AppendRune(out, foldRune(r))
    		i += n
    	}
    	return out
    }
    
    // foldRune is returns the smallest rune for all runes in the same fold set.
    func foldRune(r rune) rune {
    	for {
    		r2 := unicode.SimpleFold(r)
    		if r2 <= r {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 27 17:37:27 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  8. src/unicode/utf16/utf16.go

    			n += 2
    		default:
    			a[n] = uint16(replacementChar)
    			n++
    		}
    	}
    	return a[:n]
    }
    
    // AppendRune appends the UTF-16 encoding of the Unicode code point r
    // to the end of p and returns the extended buffer. If the rune is not
    // a valid Unicode code point, it appends the encoding of U+FFFD.
    func AppendRune(a []uint16, r rune) []uint16 {
    	// This function is inlineable for fast handling of ASCII.
    	switch {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  9. src/syscall/exec_windows.go

    		}
    		length += len(s) + 1
    	}
    	length += 1
    
    	b := make([]uint16, 0, length)
    	for _, s := range envv {
    		for _, c := range s {
    			b = utf16.AppendRune(b, c)
    		}
    		b = utf16.AppendRune(b, 0)
    	}
    	b = utf16.AppendRune(b, 0)
    	return b, nil
    }
    
    func CloseOnExec(fd Handle) {
    	SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 28 18:29:48 UTC 2023
    - 10.3K bytes
    - Viewed (0)
  10. src/strings/builder.go

    // WriteRune appends the UTF-8 encoding of Unicode code point r to b's buffer.
    // It returns the length of r and a nil error.
    func (b *Builder) WriteRune(r rune) (int, error) {
    	b.copyCheck()
    	n := len(b.buf)
    	b.buf = utf8.AppendRune(b.buf, r)
    	return len(b.buf) - n, nil
    }
    
    // WriteString appends the contents of s to b's buffer.
    // It returns the length of s and a nil error.
    func (b *Builder) WriteString(s string) (int, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:09:59 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top