Skip to content

Commit

Permalink
Replace StandardCharsets.UTF_8 with Encoding.UTF8 in two tests, #1076
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Jan 11, 2025
1 parent c07cc87 commit b850580
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public virtual void TestArray()
int size = 1 + Random.Next(50);
// This test is turning random bytes into a string,
// this is asking for trouble.
Encoding decoder = StandardCharsets.UTF_8; // LUCENENET specific: no need to set decoder fallback, because it already replaces by default
Encoding decoder = Encoding.UTF8; // LUCENENET specific: no need to set decoder fallback, because Encoding.UTF8 already replaces by default
string s = decoder.GetString(buffer, 0, size);
array.Append(s);
builder.Append(s);
Expand All @@ -59,7 +59,7 @@ public virtual void TestArray()
int size = 1 + Random.Next(50);
// This test is turning random bytes into a string,
// this is asking for trouble.
Encoding decoder = StandardCharsets.UTF_8; // LUCENENET specific: no need to set decoder fallback, because it already replaces by default
Encoding decoder = Encoding.UTF8; // LUCENENET specific: no need to set decoder fallback, because Encoding.UTF8 already replaces by default
string s = decoder.GetString(buffer, 0, size);
array.Append(s);
builder.Append(s);
Expand All @@ -71,7 +71,7 @@ public virtual void TestArray()
int size = 1 + Random.Next(50);
// This test is turning random bytes into a string,
// this is asking for trouble.
Encoding decoder = StandardCharsets.UTF_8; // LUCENENET specific: no need to set decoder fallback, because it already replaces by default
Encoding decoder = Encoding.UTF8; // LUCENENET specific: no need to set decoder fallback, because Encoding.UTF8 already replaces by default
string s = decoder.GetString(buffer, 0, size);
for (int j = 0; j < s.Length; j++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public virtual void TestL2O()

// This test is turning random bytes into a string,
// this is asking for trouble.
Encoding decoder = StandardCharsets.UTF_8; // LUCENENET specific: no need to set decoder fallback, because it already replaces by default
Encoding decoder = Encoding.UTF8; // LUCENENET specific: no need to set decoder fallback, because Encoding.UTF8 already replaces by default
uniqueValues[i] = decoder.GetString(buffer, 0, size);
// we cannot have empty path components, so eliminate all prefix as well
// as middle consecutive delimiter chars.
Expand Down

0 comments on commit b850580

Please sign in to comment.