- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for DecodeLastRune (0.14 sec)
-
src/unicode/utf8/utf8_test.go
} si += size1 } j-- for si = len(s); si > 0; { r1, size1 := DecodeLastRune(b[0:si]) r2, size2 := DecodeLastRuneInString(s[0:si]) if size1 != size2 { t.Errorf("DecodeLastRune/DecodeLastRuneInString(%q, %d) size mismatch %d/%d", s, si, size1, size2) return } if r1 != index[j].r { t.Errorf("DecodeLastRune(%q, %d) = %#04x, want %#04x", s, si, r1, index[j].r) return }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Sep 07 06:17:15 UTC 2022 - 16.2K bytes - Viewed (0) -
src/unicode/utf8/utf8.go
} s3 := s[3] if s3 < locb || hicb < s3 { return RuneError, 1 } return rune(s0&mask4)<<18 | rune(s1&maskx)<<12 | rune(s2&maskx)<<6 | rune(s3&maskx), 4 } // DecodeLastRune unpacks the last UTF-8 encoding in p and returns the rune and // its width in bytes. If p is empty it returns ([RuneError], 0). Otherwise, if // the encoding is invalid, it returns (RuneError, 1). Both are impossible
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 08 02:00:36 UTC 2024 - 16.4K bytes - Viewed (0) -
src/html/template/js.go
if len(b) == 0 { // In, `x=y/{{.}}*z` a json.Marshaler that produces "" should // not cause the output `x=y/*z`. return " null " } first, _ := utf8.DecodeRune(b) last, _ := utf8.DecodeLastRune(b) var buf strings.Builder // Prevent IdentifierNames and NumericLiterals from running into // keywords: in, instanceof, typeof, void pad := isJSIdentPart(first) || isJSIdentPart(last) if pad {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 26 19:58:28 UTC 2024 - 14.1K bytes - Viewed (0) -
src/regexp/regexp.go
r1, r2 := endOfText, endOfText // 0 < pos && pos <= len(i.str) if uint(pos-1) < uint(len(i.str)) { r1 = rune(i.str[pos-1]) if r1 >= utf8.RuneSelf { r1, _ = utf8.DecodeLastRune(i.str[:pos]) } } // 0 <= pos && pos < len(i.str) if uint(pos) < uint(len(i.str)) { r2 = rune(i.str[pos]) if r2 >= utf8.RuneSelf { r2, _ = utf8.DecodeRune(i.str[pos:]) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:50:01 UTC 2024 - 38.5K bytes - Viewed (0)