runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[Port] System.Text.EncoderFallbackException: Unable to translate Unicode character

Open shmao opened this issue 10 years ago • 0 comments

We fixed the issue on desktop. We need to port the fix to .Net Core.

  Discovering: System.Runtime.Serialization.Xml.Tests
  Discovered:  System.Runtime.Serialization.Xml.Tests
  Starting:    System.Runtime.Serialization.Xml.Tests
     XmlDictionaryWriterTest.XmlDictionaryWriter_InvalidUnicodeChar [FAIL]
        System.Text.EncoderFallbackException : Unable to translate Unicode character \uDB1B at index 0 to specified code page.
        Stack Trace:
              at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
              at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
              at System.Text.UTF8Encoding.GetByteCount(Char* chars, Int32 count, EncoderNLS baseEncoder)
              at System.Text.UTF8Encoding.GetByteCount(String chars)
              at System.Text.Encoding.GetBytes(String s)
           D:\OSS\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlStreamNodeWriter.cs(468,0): atSystem.Xml.XmlStreamNodeWriter.UnsafeGetUTF8Chars(Char* chars, Int32 charCount, Byte[] buffer, Int32 offset)
           D:\OSS\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlStreamNodeWriter.cs(354,0): atSystem.Xml.XmlStreamNodeWriter.UnsafeWriteUTF8Chars(Char* chars, Int32 charCount)
           D:\OSS\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextWriter.cs(480,0): at System.Xml.XmlUTF8NodeWriter.UnsafeWriteEscapedText(Char* chars, Int32 count)
           D:\OSS\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextWriter.cs(447,0): at System.Xml.XmlUTF8NodeWriter.WriteEscapedText(String s)
           D:\OSS\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBaseWriter.cs(1019,0): at System.Xml.XmlBaseWriter.WriteString(String value)
           D:\OSS\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlDictionaryAsyncCheckWriter.cs(381,0): at System.Xml.XmlDictionaryAsyncCheckWriter.WriteString(String text)
           D:\OSS\corefx\src\System.Runtime.Serialization.Xml\tests\XmlDictionaryWriterTest.cs(127,0): at XmlDictionaryWriterTest.XmlDictionaryWriter_InvalidUnicodeChar()
  Finished:    System.Runtime.Serialization.Xml.Tests

shmao avatar Feb 12 '16 19:02 shmao