Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for UTF8 (0.14 sec)

  1. guava-tests/test/com/google/common/base/Utf8Test.java

        ILL_FORMED_STRINGS = builder.build();
      }
    
      public void testEncodedLength_validStrings() {
        assertEquals(0, Utf8.encodedLength(""));
        assertEquals(11, Utf8.encodedLength("Hello world"));
        assertEquals(8, Utf8.encodedLength("Résumé"));
        assertEquals(
            461,
            Utf8.encodedLength(
                "威廉·莎士比亞(William Shakespeare,"
                    + "1564年4月26號—1616年4月23號[1])係隻英國嗰演員、劇作家同詩人,"
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  2. src/bytes/bytes.go

    // It returns -1 if rune is not present in s.
    // If r is utf8.RuneError, it returns the first instance of any
    // invalid UTF-8 byte sequence.
    func IndexRune(s []byte, r rune) int {
    	switch {
    	case 0 <= r && r < utf8.RuneSelf:
    		return IndexByte(s, byte(r))
    	case r == utf8.RuneError:
    		for i := 0; i < len(s); {
    			r1, n := utf8.DecodeRune(s[i:])
    			if r1 == utf8.RuneError {
    				return i
    			}
    			i += n
    		}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/base/Utf8Test.java

        ILL_FORMED_STRINGS = builder.build();
      }
    
      public void testEncodedLength_validStrings() {
        assertEquals(0, Utf8.encodedLength(""));
        assertEquals(11, Utf8.encodedLength("Hello world"));
        assertEquals(8, Utf8.encodedLength("Résumé"));
        assertEquals(
            461,
            Utf8.encodedLength(
                "威廉·莎士比亞(William Shakespeare,"
                    + "1564年4月26號—1616年4月23號[1])係隻英國嗰演員、劇作家同詩人,"
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  4. src/bufio/scan.go

    	if atEOF && len(data) == 0 {
    		return 0, nil, nil
    	}
    
    	// Fast path 1: ASCII.
    	if data[0] < utf8.RuneSelf {
    		return 1, data[0:1], nil
    	}
    
    	// Fast path 2: Correct UTF-8 decode without error.
    	_, width := utf8.DecodeRune(data)
    	if width > 1 {
    		// It's a valid encoding. Width cannot be one for a correctly encoded
    		// non-ASCII rune.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 14.2K bytes
    - Viewed (0)
  5. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

        assertThat(Adapters.INTEGER_AS_BIG_INTEGER.toDer(bigInteger)).isEqualTo(bytes)
      }
    
      @Test fun `utf8 string`() {
        val bytes = "0c04f09f988e".decodeHex()
        assertThat(Adapters.UTF8_STRING.fromDer(bytes)).isEqualTo("\uD83D\uDE0E")
        assertThat(Adapters.UTF8_STRING.toDer("\uD83D\uDE0E")).isEqualTo(bytes)
      }
    
      @Test fun `ia5 string`() {
        val bytes = "16026869".decodeHex()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  6. src/bufio/bufio.go

    func (b *Reader) ReadRune() (r rune, size int, err error) {
    	for b.r+utf8.UTFMax > b.w && !utf8.FullRune(b.buf[b.r:b.w]) && b.err == nil && b.w-b.r < len(b.buf) {
    		b.fill() // b.w-b.r < len(buf) => buffer is not full
    	}
    	b.lastRuneSize = -1
    	if b.r == b.w {
    		return 0, 0, b.readErr()
    	}
    	r, size = rune(b.buf[b.r]), 1
    	if r >= utf8.RuneSelf {
    		r, size = utf8.DecodeRune(b.buf[b.r:b.w])
    	}
    	b.r += size
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
  7. 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 {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  8. src/bytes/buffer.go

    func (b *Buffer) WriteRune(r rune) (n int, err error) {
    	// Compare as uint32 to correctly handle negative runes.
    	if uint32(r) < utf8.RuneSelf {
    		b.WriteByte(byte(r))
    		return 1, nil
    	}
    	b.lastRead = opInvalid
    	m, ok := b.tryGrowByReslice(utf8.UTFMax)
    	if !ok {
    		m = b.grow(utf8.UTFMax)
    	}
    	b.buf = utf8.AppendRune(b.buf[:m], r)
    	return len(b.buf) - m, nil
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/UrlComponentEncodingTester.kt

          }
        },
        PERCENT {
          override fun encode(codePoint: Int): String {
            val utf8 = IDENTITY.encode(codePoint).encodeUtf8()
            val percentEncoded = Buffer()
            for (i in 0 until utf8.size) {
              percentEncoded.writeUtf8("%")
                .writeUtf8(ByteString.of(utf8[i]).hex().uppercase())
            }
            return percentEncoded.readUtf8()
          }
        },
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  10. src/bufio/scan_test.go

    import (
    	. "bufio"
    	"bytes"
    	"errors"
    	"io"
    	"strings"
    	"testing"
    	"unicode"
    	"unicode/utf8"
    )
    
    const smallMaxTokenSize = 256 // Much smaller for more efficient testing.
    
    // Test white space table matches the Unicode definition.
    func TestSpace(t *testing.T) {
    	for r := rune(0); r <= utf8.MaxRune; r++ {
    		if IsSpace(r) != unicode.IsSpace(r) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Sep 22 16:22:42 GMT 2023
    - 14.3K bytes
    - Viewed (0)
Back to top