lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/5] lucenenet git commit: make sure to use offset / length when comparing uft8 buffer
Date Wed, 31 Dec 2014 08:39:45 GMT
make sure to use offset / length when comparing uft8 buffer


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/80e1f922
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/80e1f922
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/80e1f922

Branch: refs/heads/master
Commit: 80e1f9226bcd026abd747de702f85721173cc36d
Parents: 0a03242
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Tue Dec 30 20:55:10 2014 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Tue Dec 30 20:55:10 2014 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/80e1f922/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
index 5263810..c639f37 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
@@ -248,7 +248,7 @@ namespace Lucene.Net.Index
                 UnicodeUtil.UTF16toUTF8(chars, 0, len, utf8);
 
                 string s1 = new string(chars, 0, len);
-                string s2 = Encoding.UTF8.GetString((byte[])(Array)utf8.Bytes);
+                string s2 = Encoding.UTF8.GetString(utf8.Bytes, utf8.Offset, utf8.Length);
                 Assert.AreEqual(s1, s2, "codepoint " + ch);
 
                 UnicodeUtil.UTF8toUTF16(utf8.Bytes, 0, utf8.Length, utf16);


Mime
View raw message