- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for EncodeRune (0.11 sec)
-
internal/s3select/jstream/scratch.go
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Sep 23 19:35:41 UTC 2024 - 758 bytes - Viewed (0) -
src/bytes/buffer_test.go
func TestRuneIO(t *testing.T) { const NRune = 1000 // Built a test slice while we write the data b := make([]byte, utf8.UTFMax*NRune) var buf Buffer n := 0 for r := rune(0); r < NRune; r++ { size := utf8.EncodeRune(b[n:], r) nbytes, err := buf.WriteRune(r) if err != nil { t.Fatalf("WriteRune(%U) error: %s", r, err) } if nbytes != size { t.Fatalf("WriteRune(%U) expected %d, got %d", r, size, nbytes) }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Sep 03 20:55:15 UTC 2024 - 18.6K bytes - Viewed (0) -
src/bufio/bufio_test.go
const NRune = 1000 byteBuf := new(bytes.Buffer) w := NewWriter(byteBuf) // Write the runes out using WriteRune buf := make([]byte, utf8.UTFMax) for r := rune(0); r < NRune; r++ { size := utf8.EncodeRune(buf, r) nbytes, err := w.WriteRune(r) if err != nil { t.Fatalf("WriteRune(0x%x) error: %s", r, err) } if nbytes != size { t.Fatalf("WriteRune(0x%x) expected %d, got %d", r, size, nbytes) }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Fri Nov 01 21:52:12 UTC 2024 - 51.6K bytes - Viewed (0) -
src/bytes/bytes.go
// The distribution of the last byte is more uniform compared to the // first byte which has a 78% chance of being [240, 243, 244]. var b [utf8.UTFMax]byte n := utf8.EncodeRune(b[:], r) last := n - 1 i := last fails := 0 for i < len(s) { if s[i] != b[last] { o := IndexByte(s[i+1:], b[last]) if o < 0 { return -1 } i += o + 1 }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Sep 03 20:55:15 UTC 2024 - 35.6K bytes - Viewed (0) -
doc/go_spec.html
integer-to-string conversions as potential errors. Library functions such as <a href="/pkg/unicode/utf8#AppendRune"><code>utf8.AppendRune</code></a> or <a href="/pkg/unicode/utf8#EncodeRune"><code>utf8.EncodeRune</code></a> should be used instead. </li> </ol> <h4 id="Conversions_from_slice_to_array_or_array_pointer">Conversions from slice to array or array pointer</h4> <p>
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Wed Oct 02 00:58:01 UTC 2024 - 282.5K bytes - Viewed (0)