Browse Source

Fix #1512: XmlDocumentationProvider Unable to load some XML files to have special characters

pull/2333/head
Siegfried Pammer 4 years ago
parent
commit
ba5d23a835
  1. 6
      ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs

6
ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs

@ -271,8 +271,8 @@ namespace ICSharpCode.Decompiler.Documentation @@ -271,8 +271,8 @@ namespace ICSharpCode.Decompiler.Documentation
char prevChar = '\0';
// buffers for use with Decoder:
byte[] input = new byte[1];
char[] output = new char[1];
readonly byte[] input = new byte[1];
readonly char[] output = new char[2];
public LinePositionMapper(FileStream fs, Encoding encoding)
{
@ -289,7 +289,7 @@ namespace ICSharpCode.Decompiler.Documentation @@ -289,7 +289,7 @@ namespace ICSharpCode.Decompiler.Documentation
if (b < 0)
throw new EndOfStreamException();
input[0] = (byte)b;
decoder.Convert(input, 0, 1, output, 0, 1, false, out int bytesUsed, out int charsUsed, out _);
decoder.Convert(input, 0, 1, output, 0, output.Length, false, out int bytesUsed, out int charsUsed, out _);
Debug.Assert(bytesUsed == 1);
if (charsUsed == 1)
{

Loading…
Cancel
Save