We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1845c38 commit e24d99cCopy full SHA for e24d99c
src/Lucene.Net.Tests/Util/TestUnicodeUtil.cs
@@ -327,5 +327,18 @@ public virtual void TestUTF8UTF16CharsRef()
327
Assert.AreEqual(cRef.ToString(), unicode);
328
}
329
330
+
331
+ [Test]
332
+ [LuceneNetSpecific] // this is a Lucene.NET specific method
333
+ public void TestTryUTF8toUTF16()
334
+ {
335
+ string unicode = TestUtil.RandomRealisticUnicodeString(Random);
336
+ var utf8 = new BytesRef(IOUtils.CHARSET_UTF_8.GetBytes(unicode));
337
338
+ bool success = UnicodeUtil.TryUTF8toUTF16(utf8, out var chars);
339
340
+ Assert.IsTrue(success);
341
+ Assert.AreEqual(unicode, chars?.ToString());
342
+ }
343
344
0 commit comments