[Mono-bugs] [Bug 361948] New: Character encoding silently fails

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 14 15:17:01 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=361948


           Summary: Character encoding silently fails
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: Other
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: ryandbair at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other


I have an application which attempts to coerce a UTF-8 string to ASCII ( I'm
glad I can say I didn't make it ). When .net on Windows fails to map it throws
System.Text.EncoderFallbackException , on Mono 1.2.6 on Linux it silently fails
and replaces the characters that can't be converted with a ?

Here's the full exception on .net:

System.Text.EncoderFallbackException: Unable to translate Unicode character
\u20
19 at index 3861 to specified code page.
   at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown,
Int3
2 index)
   at System.Xml.CharEntityEncoderFallbackBuffer.Fallback(Char charUnknown,
Int3
2 index)
   at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
   at System.Text.ASCIIEncoding.GetBytes(Char* chars, Int32 charCount, Byte*
byt
es, Int32 byteCount, EncoderNLS encoder)
   at System.Text.EncoderNLS.Convert(Char* chars, Int32 charCount, Byte* bytes,
Int32 byteCount, Boolean flush, Int32& charsUsed, Int32& bytesUsed, Boolean&
com
pleted)
   at System.Text.EncoderNLS.Convert(Char[] chars, Int32 charIndex, Int32
charCo
unt, Byte[] bytes, Int32 byteIndex, Int32 byteCount, Boolean flush, Int32&
chars
Used, Int32& bytesUsed, Boolean& completed)
   at System.Xml.XmlEncodedRawTextWriter.EncodeChars(Int32 startOffset, Int32
en
dOffset, Boolean writeAllToStream)
   at System.Xml.XmlEncodedRawTextWriter.FlushBuffer()
   at System.Xml.XmlEncodedRawTextWriter.WriteRawWithCharChecking(Char*
pSrcBegi
n, Char* pSrcEnd)
   at System.Xml.XmlEncodedRawTextWriter.WriteRaw(String data)
   at System.Xml.XmlWellFormedWriter.WriteRaw(String data)
   at TPConsole.Program.CreateTP(String XMLName)

Personally, I find the silent failure a bit concerning!


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list