Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleEncodeRune_outOfRange (0.35 sec)

  1. src/unicode/utf8/example_test.go

    func ExampleEncodeRune() {
    	r := 'δΈ–'
    	buf := make([]byte, 3)
    
    	n := utf8.EncodeRune(buf, r)
    
    	fmt.Println(buf)
    	fmt.Println(n)
    	// Output:
    	// [228 184 150]
    	// 3
    }
    
    func ExampleEncodeRune_outOfRange() {
    	runes := []rune{
    		// Less than 0, out of range.
    		-1,
    		// Greater than 0x10FFFF, out of range.
    		0x110000,
    		// The Unicode replacement character.
    		utf8.RuneError,
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 05 21:29:18 UTC 2021
    - 3.6K bytes
    - Viewed (0)
Back to top