[
  {
    "Id": "654603",
    "ThreadId": "268225",
    "Html": "<p>I am getting the following exception when attempting to run the following code in Silverlight</p>\n<p>{System.TypeInitializationException: The type initializer for 'Ionic.Zlib.GZipStream' threw an exception. ---&gt; System.ArgumentException: 'iso-8859-1' is not a supported encoding name.</p>\n<p>Parameter name: name<br /> &nbsp;&nbsp; at System.Globalization.EncodingTable.internalGetCodePageFromName(String name)<br /> &nbsp;&nbsp; at System.Globalization.EncodingTable.GetCodePageFromName(String name)<br /> &nbsp;&nbsp; at System.Text.Encoding.GetEncoding(String name)<br /> &nbsp;&nbsp; at Ionic.Zlib.GZipStream..cctor()</p>\n<p>&nbsp;</p>\n<p>Code:</p>\n<p>Stream decompressor = new GZipStream(inputStream, CompressionMode.Decompress, true)</p>\n<p>&nbsp;</p>\n<p>&nbsp;</p>\n<p>Update: I had a look at the code and saw that that code page should only be used in comments and filenames which should not be there in the stream I am trying to decompress. I did see this line of code in GZipStream.cs though.</p>\n<p>internal static readonly System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding(\"iso-8859-1\");</p>\n<p>&nbsp;</p>\n<p>This post here http://stackoverflow.com/questions/1452366/is-iso-8859-1-supported-in-silverlight</p>\n<p>seems to indicate iso-8859-1 is not supported in Silverlight ??</p>\n<p>Have you run this under SL ?</p>",
    "PostedDate": "2011-08-08T08:31:57.79-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "654646",
    "ThreadId": "268225",
    "Html": "<p>guess I answered this for myself, still would like your insight Cheeso</p>",
    "PostedDate": "2011-08-08T09:17:36.22-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "654678",
    "ThreadId": "268225",
    "Html": "<p>I didn't test exhaustively in SL - I have a test suite but it runs in the .NET framework.&nbsp; Looks like this was missed - there's no way the GZipStream would ever have run.&nbsp; Because GZIP always uses iso-8859-1, and SL lacks it, I'd need to build a text encoder/decoder just for SL to get this to work.&nbsp;</p>\r\n<p>If you know Silverlight and are willing to contribute, there's an opportunity in this project to do SL development and maintenance on the library. The addition of an iso-8859-1 text encoder is just the start.&nbsp; Another big example is Unit testing: I'd like to have a release gate that includes&nbsp;SL tests.&nbsp; Currently these are manual. Also - SL examples. I produce and maintain a set of examples showing how to use DotNetZip in various ways; it would be good to have some Silverlight examples added to the set.&nbsp;&nbsp; Performance measurement and testing.&nbsp; I'm sure there are other opportunities, too.&nbsp;</p>\r\n<p>Interested?</p>",
    "PostedDate": "2011-08-08T10:09:42-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "654690",
    "ThreadId": "268225",
    "Html": "<p>Thanks for the answer Cheeso. I am not sure how much I could contribute at this time due to my commitments, but there may be an easy solution</p>\r\n<p>http://www.hardcodet.net/2010/03/silverlight-text-encoding-class-generator</p>\r\n<p>That pretty much generates the iso-8859-1 encoder SL code, though one thing that is not clear there is the license for the generated code.</p>\r\n<p>&nbsp;</p>\r\n<p>Also regarding examples, I looked at the documentation example and pretty much I didn't have to do anything different in SL for the simple decompression case.</p>",
    "PostedDate": "2011-08-08T10:23:54.76-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "654746",
    "ThreadId": "268225",
    "Html": "<p>I will check that out, thank you.</p>",
    "PostedDate": "2011-08-08T11:51:48.887-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "654748",
    "ThreadId": "268225",
    "Html": "<p>I also have some good news, I tried a modified version of the library that does not use the iso encoding (since I did not need filenames or comments) and it ran fine in a true SL environment for my test cases.</p>",
    "PostedDate": "2011-08-08T11:56:11.6-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "654833",
    "ThreadId": "268225",
    "Html": "<p>great ! Glad you were able to proceed.</p>\r\n<p>I also have some good news. I did some research and learned that iso-8859-1 encodes in the range of 0 to 255, and the characters in iso-8859-1 are the same as the Unicode characters in that range.&nbsp; Therefore encoding and decoding is trivial.&nbsp;&nbsp;&nbsp;The generated class from the hardcode website is much more complicated than it needs to be for iso-8859-1. It's a good general solution but it isn't necessary for Latin1.</p>\r\n<p>The encoder is basically this:</p>\r\n<div style=\"color: black; background-color: white;\">\r\n<pre>      <span style=\"color: blue;\">for</span> (<span style=\"color: blue;\">int</span> i=0; i &lt; count; i++)\r\n      {\r\n          <span style=\"color: blue;\">char</span> c = chars[start+i]; <span style=\"color: green;\">// get the unicode char</span>\r\n          <span style=\"color: blue;\">if</span> (c &gt;= <span style=\"color: #a31515;\">'\\x00FF'</span>) <span style=\"color: green;\">// out of range?</span>\r\n              bytes[byteIndex+i] = (<span style=\"color: blue;\">byte</span>) <span style=\"color: #a31515;\">'?'</span>;\r\n          <span style=\"color: blue;\">else</span>\r\n              bytes[byteIndex+i] = (<span style=\"color: blue;\">byte</span>) c;\r\n      }\r\n</pre>\r\n</div>\r\n<p>That will be easy to add into the library in the future. I've already made that change, so it will show up in the next binary release.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-08-08T15:22:58.377-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "654836",
    "ThreadId": "268225",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/workitem/14045\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2011-08-08T15:24:53.157-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]