diff --git a/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs b/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs index 16337defbd..9275b1545f 100644 --- a/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs +++ b/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs @@ -1,4 +1,5 @@ using J2N.Text; +using Lucene.Net.Support; using NUnit.Framework; using System; using System.Text; @@ -108,7 +109,7 @@ public virtual void TestCompressionTools() // fetch the binary compressed field and compare it's content with the original one // LUCENENET: was `= new String(CompressionTools.decompress(docFromReader.getBinaryValue("binaryCompressed")), StandardCharsets.UTF_8);` string binaryFldCompressedTest = - Encoding.UTF8.GetString( + StandardCharsets.UTF_8.GetString( CompressionTools.Decompress(docFromReader.GetBinaryValue("binaryCompressed"))); Assert.IsTrue(binaryFldCompressedTest.Equals(binaryValCompressed, StringComparison.Ordinal)); Assert.IsTrue( diff --git a/src/Lucene.Net/Support/StandardCharsets.cs b/src/Lucene.Net/Support/StandardCharsets.cs new file mode 100644 index 0000000000..781f3b3aea --- /dev/null +++ b/src/Lucene.Net/Support/StandardCharsets.cs @@ -0,0 +1,26 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +using Lucene.Net.Util; +using System.Text; + +namespace Lucene.Net.Support; + +internal static class StandardCharsets +{ + public static readonly Encoding UTF_8 = IOUtils.CHARSET_UTF_8; +}