[Mono-dev] Proposed changes to mono/mcs/class/corlib/Mono/DataConverter.cs

Michael McGlothlin mike.mcglothlin at gmail.com
Tue Dec 9 03:54:08 UTC 2014


Couldn't figure out how to get Xamarin Studio to create an actual patch
file after trying, and failing, to push a change with git. It appears this
is the correct place to post this?

I usually put most of my code in PCL and then call it from platform
specific code so I'm trying to make DataConverter happy as PCL.

To make DataConverter compile as PCL I had to change Encoding.UTF7 to
Encoding.GetEncoding ( "utf-7" ) and the numeric calls to 12000 and 12001
on GetEncoding() to the string-based "utf-32" and "uff-32BE". These three
changes had to be made twice as there are two variants using this same
code. I also changed ArrayList to List<object> to make PCL happy.



case '7':
e = Encoding.GetEncoding ("utf-7");
n = 1;
break;
case '3':
e = Encoding.GetEncoding ("utf-32");
n = 4;
break;
case '4':
e = Encoding.GetEncoding ("utf-32BE");
n = 4;
break;



static public IList Unpack (string description, byte[] buffer, int
startIndex)
{
DataConverter conv = CopyConv;
var result = new List<object> ();
int idx = startIndex;
bool align = false;
int repeat = 0, n;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20141208/0d7c2255/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DataConverter.cs
Type: application/octet-stream
Size: 46079 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20141208/0d7c2255/attachment-0001.obj>


More information about the Mono-devel-list mailing list