Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for ReplacementChar (0.37 sec)

  1. src/unicode/utf16/utf16.go

    // Package utf16 implements encoding and decoding of UTF-16 sequences.
    package utf16
    
    // The conditions replacementChar==unicode.ReplacementChar and
    // maxRune==unicode.MaxRune are verified in the tests.
    // Defining them locally avoids this package depending on package unicode.
    
    const (
    	replacementChar = '\uFFFD'     // Unicode replacement character
    	maxRune         = '\U0010FFFF' // Maximum valid Unicode code point.
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  2. src/unicode/utf16/export_test.go

    package utf16
    
    // Extra names for constants so we can validate them during testing.
    const (
    	Surr1           = surr1
    	Surr3           = surr3
    	SurrSelf        = surrSelf
    	MaxRune         = maxRune
    	ReplacementChar = replacementChar
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 394 bytes
    - Viewed (0)
  3. src/unicode/utf16/utf16_test.go

    func TestConstants(t *testing.T) {
    	if MaxRune != unicode.MaxRune {
    		t.Errorf("utf16.maxRune is wrong: %x should be %x", MaxRune, unicode.MaxRune)
    	}
    	if ReplacementChar != unicode.ReplacementChar {
    		t.Errorf("utf16.replacementChar is wrong: %x should be %x", ReplacementChar, unicode.ReplacementChar)
    	}
    }
    
    func TestRuneLen(t *testing.T) {
    	for _, tt := range []struct {
    		r      rune
    		length int
    	}{
    		{0, 1},
    		{Surr1 - 1, 1},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  4. src/unicode/letter.go

    // Package unicode provides data and functions to test some properties of
    // Unicode code points.
    package unicode
    
    const (
    	MaxRune         = '\U0010FFFF' // Maximum valid Unicode code point.
    	ReplacementChar = '\uFFFD'     // Represents invalid code points.
    	MaxASCII        = '\u007F'     // maximum ASCII value.
    	MaxLatin1       = '\u00FF'     // maximum Latin-1 value.
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 06 20:02:46 UTC 2023
    - 10K bytes
    - Viewed (0)
  5. src/internal/fuzz/encoding_test.go

    			t.Errorf("unmarshaled %v (bits 0x%x)", x2, u2)
    		}
    	})
    }
    
    func FuzzRuneRoundTrip(f *testing.F) {
    	f.Add(rune(-1))
    	f.Add(rune(0xd800))
    	f.Add(rune(0xdfff))
    	f.Add(rune(unicode.ReplacementChar))
    	f.Add(rune(unicode.MaxASCII))
    	f.Add(rune(unicode.MaxLatin1))
    	f.Add(rune(unicode.MaxRune))
    	f.Add(rune(unicode.MaxRune + 1))
    	f.Add(rune(-0x80000000))
    	f.Add(rune(0x7fffffff))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 00:20:34 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  6. src/go/types/conversions.go

    		switch t, _ := under(T).(*Basic); {
    		case t == nil:
    			// nothing to do
    		case representableConst(x.val, check, t, val):
    			return true
    		case isInteger(x.typ) && isString(t):
    			codepoint := unicode.ReplacementChar
    			if i, ok := constant.Uint64Val(x.val); ok && i <= unicode.MaxRune {
    				codepoint = rune(i)
    			}
    			if val != nil {
    				*val = constant.MakeString(string(codepoint))
    			}
    			return true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 18:51:00 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  7. src/mime/encodedword.go

    		for _, c := range content {
    			buf.WriteRune(rune(c))
    		}
    	case strings.EqualFold("us-ascii", charset):
    		for _, c := range content {
    			if c >= utf8.RuneSelf {
    				buf.WriteRune(unicode.ReplacementChar)
    			} else {
    				buf.WriteByte(c)
    			}
    		}
    	default:
    		if d.CharsetReader == nil {
    			return fmt.Errorf("mime: unhandled charset %q", charset)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 16:12:35 UTC 2024
    - 10K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/conversions.go

    		switch t, _ := under(T).(*Basic); {
    		case t == nil:
    			// nothing to do
    		case representableConst(x.val, check, t, val):
    			return true
    		case isInteger(x.typ) && isString(t):
    			codepoint := unicode.ReplacementChar
    			if i, ok := constant.Uint64Val(x.val); ok && i <= unicode.MaxRune {
    				codepoint = rune(i)
    			}
    			if val != nil {
    				*val = constant.MakeString(string(codepoint))
    			}
    			return true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 18:51:00 UTC 2024
    - 9K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/typecheck/const.go

    		}
    	}
    
    	// Prevent follow-on errors.
    	return constant.MakeUnknown()
    }
    
    func tostr(v constant.Value) constant.Value {
    	if v.Kind() == constant.Int {
    		r := unicode.ReplacementChar
    		if x, ok := constant.Uint64Val(v); ok && x <= unicode.MaxRune {
    			r = rune(x)
    		}
    		v = constant.MakeString(string(r))
    	}
    	return v
    }
    
    func makeFloat64(f float64) constant.Value {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 10.5K bytes
    - Viewed (0)
  10. src/cmd/vendor/rsc.io/markdown/html.go

    			}
    			if j-i < 1 || j-i > 7 || j >= len(s) || s[j] != ';' {
    				return nil, 0, 0, false
    			}
    			r, _ = strconv.Atoi(s[i:j])
    			end = j + 1
    		}
    		if r > unicode.MaxRune || r == 0 {
    			r = unicode.ReplacementChar
    		}
    		return &Plain{string(rune(r))}, start, end, true
    	}
    
    	// Max name in list is 32 bytes. Try for 64 for good measure.
    	for j := i + 1; j < len(s) && j-i < 64; j++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 11.9K bytes
    - Viewed (0)
Back to top