[PATCH] Re: [Mono-list] windows code pages?

Jaroslaw Kowalski jaak@zd.com.pl
Thu, 6 May 2004 00:26:27 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_00D7_01C43300.C5226A00
Content-Type: text/plain;
	charset="iso-8859-2"
Content-Transfer-Encoding: 7bit

I found the solution to this problem. I18N was broken badly.
As one could expect it was related to GAC. I18N.Common.Manager called
Assembly.Load() without specifying the fully qualified name.

Patch is attached. Is it ok to commit?

Jarek

----- Original Message ----- 
From: "Jaroslaw Kowalski" <jaak@zd.com.pl>
To: <mono-list@lists.ximian.com>
Sent: Wednesday, May 05, 2004 4:11 PM
Subject: [Mono-list] windows code pages?


Hi!

I've noticed that I'm no longer able to process XML files encoded using
windows-1252 and windows-1250 codepages. This applies to web.config,
*.exe.config and any xml files I read. iso-8859-1, iso-8859-2 and utf-8 work
fine.

I have ICU 2.8 installed from source and mono says it's using it. I wanted
to check if the icudata contains the codepages so I've run:

# strings /opt/mono/lib/libicudata.so | grep "windows-125" | more

and it produced:

windows-1250
windows-1251
windows-1252
windows-1253
windows-1254
windows-1255
windows-1256-2000
windows-1256
windows-1257
windows-1258
windows-1250
windows-1251
windows-1252
windows-1253
windows-1254
windows-1255
windows-1256
windows-1257
windows-1258
windows-1256-2000

which suggests that ICU is compiled with the appropriate support for windows
codepages.

Do you have any idea what might have happened ? I remember it working
correctly about 2 months ago.

Jarek

------=_NextPart_000_00D7_01C43300.C5226A00
Content-Type: application/octet-stream;
	name="i18n.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="i18n.patch"

? class/Commons.Xml.Relaxng/y.output=0A=
Index: class/I18N/Common/Manager.cs=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /cvs/public/mcs/class/I18N/Common/Manager.cs,v=0A=
retrieving revision 1.3=0A=
diff -u -r1.3 Manager.cs=0A=
--- class/I18N/Common/Manager.cs	16 Jan 2004 05:25:53 -0000	1.3=0A=
+++ class/I18N/Common/Manager.cs	5 May 2004 21:24:20 -0000=0A=
@@ -211,7 +211,10 @@=0A=
 					{=0A=
 						try=0A=
 						{=0A=
-							assembly =3D Assembly.Load(region);=0A=
+							// we use the same strong name as I18N.dll except the assembly =
name=0A=
+							AssemblyName myName =3D typeof(Manager).Assembly.GetName();=0A=
+							myName.Name =3D region;=0A=
+							assembly =3D Assembly.Load(myName);=0A=
 						}=0A=
 						catch(SystemException)=0A=
 						{=0A=

------=_NextPart_000_00D7_01C43300.C5226A00--