- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 25 for surrogate (0.04 sec)
-
android/guava-tests/test/com/google/common/base/Utf8Test.java
char[] surrogates = { MAX_LOW_SURROGATE, MAX_HIGH_SURROGATE, MIN_LOW_SURROGATE, MIN_HIGH_SURROGATE, }; for (char surrogate : surrogates) { builder.add(newString(surrogate)); builder.add(newString(surrogate, 'n')); builder.add(newString('n', surrogate)); builder.add(newString(surrogate, surrogate)); }
Registered: 2025-05-30 12:43 - Last Modified: 2024-12-19 18:03 - 12.8K bytes - Viewed (0) -
android/guava/src/com/google/common/escape/ArrayBasedUnicodeEscaper.java
// into the range of surrogate characters, but if they do we must not test // any values in that range. To see why, consider the case where: // safeMin <= {hi,lo} <= safeMax // where {hi,lo} are characters forming a surrogate pair such that: // codePointOf(hi, lo) > safeMax // which would result in the surrogate pair being (wrongly) considered safe.
Registered: 2025-05-30 12:43 - Last Modified: 2025-02-13 15:45 - 8.5K bytes - Viewed (0) -
guava-tests/test/com/google/common/base/StringsTest.java
assertEquals("abc", Strings.commonPrefix(new StringBuilder("abcdef"), "abcxyz")); // Identical valid surrogate pairs. assertEquals( "abc\uD8AB\uDCAB", Strings.commonPrefix("abc\uD8AB\uDCABdef", "abc\uD8AB\uDCABxyz")); // Differing valid surrogate pairs. assertEquals("abc", Strings.commonPrefix("abc\uD8AB\uDCABdef", "abc\uD8AB\uDCACxyz")); // One invalid pair.
Registered: 2025-05-30 12:43 - Last Modified: 2024-12-21 14:50 - 10.4K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/base/StringsTest.java
assertEquals("abc", Strings.commonPrefix(new StringBuilder("abcdef"), "abcxyz")); // Identical valid surrogate pairs. assertEquals( "abc\uD8AB\uDCAB", Strings.commonPrefix("abc\uD8AB\uDCABdef", "abc\uD8AB\uDCABxyz")); // Differing valid surrogate pairs. assertEquals("abc", Strings.commonPrefix("abc\uD8AB\uDCABdef", "abc\uD8AB\uDCACxyz")); // One invalid pair.
Registered: 2025-05-30 12:43 - Last Modified: 2024-12-21 14:50 - 10.4K bytes - Viewed (0) -
android/guava/src/com/google/common/base/Utf8.java
utf8Length += (0x7f - c) >>> 31; // branch free! } else { utf8Length += 2; // We can't use Character.isSurrogate(c) here and below because of GWT. if (MIN_SURROGATE <= c && c <= MAX_SURROGATE) { // Check that we have a well-formed surrogate pair. if (Character.codePointAt(sequence, i) == c) { throw new IllegalArgumentException(unpairedSurrogateMsg(i)); }
Registered: 2025-05-30 12:43 - Last Modified: 2025-02-12 03:49 - 7K bytes - Viewed (0) -
android/guava-testlib/src/com/google/common/escape/testing/EscaperAsserts.java
} /** * Asserts that a Unicode escaper escapes the given hi/lo surrogate pair into the expected string. * * @param escaper the non-null escaper to test * @param expected the expected output string * @param hi the high surrogate pair character * @param lo the low surrogate pair character */ public static void assertUnicodeEscaping(
Registered: 2025-05-30 12:43 - Last Modified: 2022-01-18 20:55 - 3.8K bytes - Viewed (0) -
guava-testlib/src/com/google/common/escape/testing/EscaperAsserts.java
} /** * Asserts that a Unicode escaper escapes the given hi/lo surrogate pair into the expected string. * * @param escaper the non-null escaper to test * @param expected the expected output string * @param hi the high surrogate pair character * @param lo the low surrogate pair character */ public static void assertUnicodeEscaping(
Registered: 2025-05-30 12:43 - Last Modified: 2022-01-18 20:55 - 3.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/escape/ArrayBasedUnicodeEscaperTest.java
}; EscaperAsserts.assertBasic(surrogateEscaper); // A surrogate pair defining a code point within the safe range. String safeInput = "\uD800\uDC00"; // 0x10000 assertThat(surrogateEscaper.escape(safeInput)).isEqualTo(safeInput); // A surrogate pair defining a code point outside the safe range (but both // of the surrogate characters lie within the safe range). It is important
Registered: 2025-05-30 12:43 - Last Modified: 2025-02-18 15:41 - 5.2K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/escape/UnicodeEscaperTest.java
// Build up a range of surrogate pair characters to test int min = Character.MIN_SUPPLEMENTARY_CODE_POINT; int max = Character.MAX_CODE_POINT; int range = max - min; int s1 = min + (1 * range) / 4; int s2 = min + (2 * range) / 4; int s3 = min + (3 * range) / 4; char[] dst = new char[12]; // Put surrogate pairs at odd indices so they can be split easily
Registered: 2025-05-30 12:43 - Last Modified: 2025-05-13 18:46 - 6K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java
StringBuilder sb = new StringBuilder(); for (int j = 0; j < charCount; j++) { int codePoint; // discard illegal surrogate "codepoints" do { codePoint = rnd.nextInt(maxCodePoint.value); } while (Character.isSurrogate((char) codePoint)); sb.appendCodePoint(codePoint); } strings[i] = sb.toString(); } } @Benchmark
Registered: 2025-05-30 12:43 - Last Modified: 2025-05-13 18:46 - 5.3K bytes - Viewed (0)