Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 65 for appendRune (0.2 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/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)
  4. 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)
  5. 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)
  6. 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)
  7. src/expvar/expvar.go

    			default:
    				b = append(b, '\\', 'u', hex[(r>>12)&0xf], hex[(r>>8)&0xf], hex[(r>>4)&0xf], hex[(r>>0)&0xf])
    			}
    		case r < utf8.RuneSelf:
    			b = append(b, byte(r))
    		default:
    			b = utf8.AppendRune(b, r)
    		}
    	}
    	b = append(b, '"')
    	return b
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 21:32:11 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  8. analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/substututorFactory/AbstractSubstitutorBuilderTest.kt

                prettyPrint {
                    appendLine("${KtDeclaration::class.simpleName}: ${declaration::class.simpleName}")
    
                    appendLine("Symbol:")
                    appendLine(symbol.render(KaDeclarationRendererForDebug.WITH_QUALIFIED_NAMES))
    
                    appendLine()
    
                    appendLine("Substitutor:")
                    appendLine(stringRepresentation(substitutor))
    
                    appendLine()
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Tue Jun 11 15:45:42 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  9. analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/importOptimizer/AbstractAnalysisApiImportOptimizerTest.kt

                    .mapValues { (_, importedNames) -> importedNames.sorted() }
    
                appendLine("USED DECLARATIONS:")
                for ((path, elements) in sortedUsedDeclarations) {
                    appendLine()
                    appendLine("Declaration: $path")
                    appendLine("By names: $elements")
                }
    
                appendLine()
    
                val sortedUnresolvedNames = importsAnalysis.unresolvedNames.sorted()
    
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Wed Mar 27 16:04:54 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  10. analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/scopeProvider/AbstractTypeScopeTest.kt

                    appendLine("Expression: ${expression.text}")
                    appendLine("${KaType::class.simpleName}: ${type.render(position = Variance.INVARIANT)}")
                    appendLine()
                    appendLine("${KaTypeScope::class.simpleName}:")
                    appendLine(typeScope?.let { renderForTests(it) } ?: "NO_SCOPE")
                    appendLine()
    
                    appendLine("Declaration Scope:")
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Wed May 29 17:43:55 UTC 2024
    - 5.5K bytes
    - Viewed (0)
Back to top