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

Charles Martin charles@acolytecommunication.com
Wed, 17 Nov 2004 09:29:10 -0500


This is a multi-part message in MIME format.
--------------050706010306070500040202
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Well, I think this has been fixed in the cvs but not in the realeased 
tarball I thnk.

I recompiled mono with the following changes and it fixed the problem :

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

Have fun !

P.S. There's a bug-report with the correspond bugfix for this but I 
haven't bookmarked it...



Charles Martin  Programmeur analyste
819.378.4242    *acolyte*communication.com
charles@acolytecommunication.com


Joshua Brickel wrote:

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

--------------050706010306070500040202
Content-Type: text/html; charset=us-ascii
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">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
Well, I think this has been fixed in the cvs but not in the realeased
tarball I thnk.<br>
<br>
I recompiled mono with the following changes and it fixed the problem :<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>
<br>
Have fun !<br>
<br>
P.S. There's a bug-report with the correspond bugfix for this but I
haven't bookmarked it...<br>
<br>
<div class="moz-signature"><img moz-do-not-send="true"
 src="http://www.acolytecommunication.com/images/acolytetag.gif" alt=""
 border="0"><br>
<br>
<font style="font-size: 12px;" color="#60614d"
 face="Arial, Helvetica, Trebuchet MS, Avant Garde, AvantGarde Bk BT"><font
 color="#7096af">Charles Martin</font>&nbsp;&nbsp;Programmeur analyste<br>
819.378.4242&nbsp;&nbsp;&nbsp;&nbsp;<b>acolyte</b>communication.com<br>
<a class="moz-txt-link-abbreviated"
 href="mailto:charles@acolytecommunication.com">charles@acolytecommunication.com</a></font><br>
</div>
<br>
<br>
Joshua Brickel wrote:
<blockquote cite="mid419B8FF2.6080504@aquanet.co.il" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
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 <font
 color="#3366ff">MySql.Data.MySqlClient.MySqlConnection.Open()</font>
appears to be calling <font color="#3366ff">System.Text.Encoding.GetEncoding("latin1");
  <font color="#000000">The reason I say this is that the error I get
when trying to open a database is:<br>
  <br>
  </font></font>&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">System.Text.Encoding.GetEncoding("latin1")
  </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>
  <br>
  <br>
</blockquote>
</body>
</html>

--------------050706010306070500040202--