projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
95f9ffa
)
[System.ServiceModel.Web] Fix JsonQueryStringConverter.ConvertValueToString to work...
author
Sebastien Pouliot
<sebastien@xamarin.com>
Tue, 18 Mar 2014 01:46:33 +0000
(21:46 -0400)
committer
Sebastien Pouliot
<sebastien@xamarin.com>
Tue, 18 Mar 2014 01:46:33 +0000
(21:46 -0400)
mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/JsonQueryStringConverter.cs
patch
|
blob
|
history
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Dispatcher/JsonQueryStringConverterTest.cs
patch
|
blob
|
history
diff --git
a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/JsonQueryStringConverter.cs
b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/JsonQueryStringConverter.cs
index 87bd458413b2699626454a24ac6dca4419e77963..41d0e7572810bd21650953001cd21c9ef731d568 100644
(file)
--- a/
mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/JsonQueryStringConverter.cs
+++ b/
mcs/class/System.ServiceModel.Web/System.ServiceModel.Dispatcher/JsonQueryStringConverter.cs
@@
-5,6
+5,7
@@
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+// Copyright 2014 Xamarin Inc. (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@
-182,7
+183,8
@@
namespace System.ServiceModel.Dispatcher
var qname = (XmlQualifiedName) parameter;
return String.Concat ("\"", qname.Name, ":", qname.Namespace, "\"");
}
var qname = (XmlQualifiedName) parameter;
return String.Concat ("\"", qname.Name, ":", qname.Namespace, "\"");
}
- return parameter.ToString ();
+ var f = (parameter as IFormattable);
+ return (f == null) ? parameter.ToString () : f.ToString (null, CultureInfo.InvariantCulture);
}
}
}
}
diff --git
a/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Dispatcher/JsonQueryStringConverterTest.cs
b/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Dispatcher/JsonQueryStringConverterTest.cs
index a05da3e5b0ee6a7bdc932b925350e98111917550..22086ca8b2d645370a453b23de5c516adc8b66bc 100644
(file)
--- a/
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Dispatcher/JsonQueryStringConverterTest.cs
+++ b/
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Dispatcher/JsonQueryStringConverterTest.cs
@@
-5,6
+5,7
@@
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+// Copyright 2014 Xamarin Inc. (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@
-32,6
+33,7
@@
using System.Globalization;
using System.Runtime.Serialization;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Runtime.Serialization;
using System.ServiceModel.Dispatcher;
using System.Text;
+using System.Threading;
using System.Xml;
using NUnit.Framework;
using System.Xml;
using NUnit.Framework;
@@
-110,6
+112,19
@@
namespace MonoTests.System.ServiceModel.Description
Assert.AreEqual ("123.45", c.ConvertValueToString (123.45, typeof (int)));
}
Assert.AreEqual ("123.45", c.ConvertValueToString (123.45, typeof (int)));
}
+ [Test]
+ public void ConvertValueToStringValidCast4_ptBR ()
+ {
+ var ci = CultureInfo.CurrentCulture;
+ try {
+ Thread.CurrentThread.CurrentCulture = new CultureInfo ("pt-BR");
+ Assert.AreEqual ("123.45", c.ConvertValueToString (123.45, typeof (int)));
+ }
+ finally {
+ Thread.CurrentThread.CurrentCulture = ci;
+ }
+ }
+
[Test]
public void ConvertValueToStringValidCast5 ()
{
[Test]
public void ConvertValueToStringValidCast5 ()
{