[Mono-bugs] [Bug 402128] New: CultureInfo serialization bug

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jun 20 09:25:59 EDT 2008


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


           Summary: CultureInfo serialization bug
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: avk at rsdn.ru
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


CultureInfo does not properly serialized or deserialized
Sample:
class Program
{
        static void Main()
        {
                var culture = new CultureInfo("en-US");
                var ms = new MemoryStream();
                var formatter = new BinaryFormatter();
                formatter.Serialize(ms, culture);
                ms.Seek(0, SeekOrigin.Begin);
                var deserializedCulture =
(CultureInfo)formatter.Deserialize(ms);
                Console.WriteLine(deserializedCulture.Parent);
        }
}

Expected result:
en

Actual result:
Unhandled Exception: System.ArgumentException: Culture ID 0 (0x0000) is not a
supported culture.
Parameter name: culture
  at System.Globalization.CultureInfo..ctor (Int32 culture, Boolean
use_user_override, Boolean read_only) [0x00000]
  at System.Globalization.CultureInfo..ctor (Int32 culture, Boolean
use_user_override) [0x00000]
  at System.Globalization.CultureInfo..ctor (Int32 culture) [0x00000]
  at System.Globalization.CultureInfo.get_Parent () [0x00000]
  at MonoCultureInfoBug.Program.Main () [0x00000]


-- 
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