[Mono-list] Problem with MySql.Data.MySqlClient.MySqlConnection.Open() or System.Text.Encoding.GetEncoding()

Joshua Brickel joshuab@aquanet.co.il
Wed, 17 Nov 2004 22:48:29 -0200


This is a multi-part message in MIME format.
--------------070007030602000903000906
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

You are kindof correct... In that yes the solution resides in updating a 
file and rcompiling.  If anyone else has such a problem here is the 
solution for mono version 1.0.4:

To quote the solution from Charles Martin:
[BeginQuote]

/root/mcs-1.0.4/class/corlib/System.Text/Encoding.cs (or wherever you 
put the source files)

Near line 393, there's a line that says something like

                        Latin1Encoding.ISOLATIN_CODE_PAGE,
                        "iso_8859_1"

Juste change the second one for

                        Latin1Encoding.ISOLATIN_CODE_PAGE,
                        "iso_8859_1", "latin1"

And recompile, everything should be fine !
[End Quote]

Regards,


Joshua


Reggie Burnett wrote:

> I think this has been fixed in Mono, but I'm not sure.
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* mono-list-admin@lists.ximian.com 
> [mailto:mono-list-admin@lists.ximian.com] *On Behalf Of *Joshua Brickel
> *Sent:* Wednesday, November 17, 2004 11:53 AM
> *To:* mono-list@lists.ximian.com
> *Subject:* [Mono-list] Problem with 
> MySql.Data.MySqlClient.MySqlConnection.Open() or 
> System.Text.Encoding.GetEncoding()
>
>  
>
> Hi,
>
> I'm not sure if this is a problem with the MySql library or with a 
> System library.  But what appears to be happenning is that  the Method 
> MySql.Data.MySqlClient.MySqlConnection.Open() appears to be calling 
> System.Text.Encoding.GetEncoding("latin1"); The reason I say this is 
> that the error I get when trying to open a database is:
>
>  Unhandled Exception: System.NotSupportedException: Encoding name 
> `latin1' not supported
> in [0x000fe] (at 
> /opt/src2/mono-all/1.0.4/mcs-1.0.4/class/corlib/System.Text/Encoding.cs:446) 
> System.Text.Encoding:GetEncoding (string)
>
> And indeed if I run just the line 
> System.Text.Encoding.GetEncoding("latin1") I get the same error of: 
> Unhandled Exception: System.NotSupportedException: Encoding name 
> `latin1' not supported
> in [0x000fe] (at 
> /opt/src2/mono-all/1.0.4/mcs-1.0.4/class/corlib/System.Text/Encoding.cs:446) 
> System.Text.Encoding:GetEncoding (string)
>
> Now I figure this is a problem either with System.Text or with the 
> Mysql.Data Library.  But I can not tell unless I can find 
> documentation of whether or not System.Text should support the string 
> value of "latin1".
>
> Does anyone know where the requirments for System.Text are kept? 
>
> In addition, apparently I will not be able to get this library to work 
> with my MySql database unless I change the language encoding.  Does 
> anyone have any experience on which charchter set is common to both 
> DotNet and MySql?
>
> Finally, does anyone know to Whom do I contact to see if I can be of 
> any help in the area of documentation?
>
> Regards,
>
> Joshua
>
>


--------------070007030602000903000906
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
You are kindof correct... In that yes the solution resides in updating
a file and rcompiling.&nbsp; If anyone else has such a problem here is the
solution for mono version 1.0.4:<br>
<br>
To quote the solution from Charles Martin:<br>
[BeginQuote]<br>
<br>
/root/mcs-1.0.4/class/corlib/System.Text/Encoding.cs (or wherever you
put the source files)<br>
<br>
Near line 393, there's a line that says something like<br>
<br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latin1Encoding.ISOLATIN_CODE_PAGE,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "iso_8859_1"</tt><br>
<br>
Juste change the second one for<br>
<br>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Latin1Encoding.ISOLATIN_CODE_PAGE,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "iso_8859_1", "latin1"</tt><br>
<br>
And recompile, everything should be fine !<br>
[End Quote]<br>
<br>
Regards,<br>
<br>
<br>
Joshua<br>
<br>
<br>
Reggie Burnett wrote:
<blockquote cite="mid200411171417.iAHEH1i3004731@main.aquanet.co.il"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="ProgId" content="Word.Document">
  <meta name="Generator" content="Microsoft Word 11">
  <meta name="Originator" content="Microsoft Word 11">
  <link rel="File-List" href="cid:filelist.xml@01C4CC7B.AE1A9D40">
  <link rel="Edit-Time-Data" href="cid:editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
span.EmailStyle17
	{mso-style-type:personal-reply;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
  </style><!--[if gte mso 10]>
<style>
 /* Style Definitions */ 
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  <div class="Section1">
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">I think this
has been fixed in Mono, but I&#8217;m
not sure.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <div
 style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0in 0in 0in 4pt;">
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 color="black" face="Times New Roman" size="3"><span
 style="font-size: 12pt; color: windowtext;">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext; font-weight: bold;">From:</span></font></b><font
 color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext;">
<a class="moz-txt-link-abbreviated" href="mailto:mono-list-admin@lists.ximian.com">mono-list-admin@lists.ximian.com</a>
[<a class="moz-txt-link-freetext" href="mailto:mono-list-admin@lists.ximian.com">mailto:mono-list-admin@lists.ximian.com</a>] <b><span
 style="font-weight: bold;">On
Behalf Of </span></b>Joshua Brickel<br>
  <b><span style="font-weight: bold;">Sent:</span></b> Wednesday,
November 17, 2004
11:53 AM<br>
  <b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:mono-list@lists.ximian.com">mono-list@lists.ximian.com</a><br>
  <b><span style="font-weight: bold;">Subject:</span></b> [Mono-list]
Problem with
MySql.Data.MySqlClient.MySqlConnection.Open() or
System.Text.Encoding.GetEncoding()</span></font><font color="black"><span
 style="color: windowtext;"><o:p></o:p></span></font></p>
  </div>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style="margin-bottom: 12pt;"><font color="black"
 face="Times New Roman" size="3"><span style="font-size: 12pt;">Hi,<br>
  <br>
I'm not sure if this is a problem with the MySql library or with a
System
library.&nbsp; But what appears to be happenning is that&nbsp; the Method </span></font><font
 color="#3366ff"><span style="color: rgb(51, 102, 255);">MySql.Data.MySqlClient.MySqlConnection.Open()</span></font>
appears to be calling <font color="#3366ff"><span
 style="color: rgb(51, 102, 255);">System.Text.Encoding.GetEncoding("latin1");
  </span></font>The reason I say this is that the error I get when
trying to open
a database is:<br>
  <br>
&nbsp;Unhandled Exception: System.NotSupportedException: Encoding name
`latin1'
not supported<br>
in [0x000fe] (at
/opt/src2/mono-all/1.0.4/mcs-1.0.4/class/corlib/System.Text/Encoding.cs:446)
System.Text.Encoding:GetEncoding (string)<br>
  <br>
And indeed if I run just the line <font color="#3366ff"><span
 style="color: rgb(51, 102, 255);">System.Text.Encoding.GetEncoding("latin1")
  </span></font>I
get the same error of:&nbsp; <br>
Unhandled Exception: System.NotSupportedException: Encoding name
`latin1' not
supported<br>
in [0x000fe] (at
/opt/src2/mono-all/1.0.4/mcs-1.0.4/class/corlib/System.Text/Encoding.cs:446)
System.Text.Encoding:GetEncoding (string)<br>
  <br>
Now I figure this is a problem either with System.Text or with the
Mysql.Data
Library.&nbsp; But I can not tell unless I can find documentation of whether
or
not System.Text should support the string value of "latin1".<br>
  <br>
Does anyone know where the requirments for System.Text are kept?&nbsp; <br>
  <br>
In addition, apparently I will not be able to get this library to work
with my
MySql database unless I change the language encoding.&nbsp; Does anyone have
any experience on which charchter set is common to both DotNet and
MySql?<br>
  <br>
Finally, does anyone know to Whom do I contact to see if I can be of
any help
in the area of documentation?<br>
  <br>
Regards,<br>
  <br>
Joshua<br>
  <br style="">
<!--[if !supportLineBreakNewLine]--><br style="">
<!--[endif]--><o:p></o:p></p>
  </div>
  </div>
</blockquote>
<br>
</body>
</html>

--------------070007030602000903000906--

II------------------------------------------------------------------------
II     AquaNet promises to take care and help its' customers stay safe       
II This Mail was Scanned By AquaNet's Anti-Virus Server And was Found OK!  
II              http://www.aquanet.co.il                                  
II------------------------------------------------------------------------