Author: miguel
Date: 2006-10-06 10:35:22 -0400 (Fri, 06 Oct 2006)
New Revision: 66353

Modified:
   trunk/mono/mono/dis/ChangeLog
   trunk/mono/mono/dis/main.c
Log:
2006-10-06  Miguel de Icaza  <[EMAIL PROTECTED]>

        * main.c (dis_directive_assembly): Fix the rendering of .locale to
        be a data dump.




Modified: trunk/mono/mono/dis/ChangeLog
===================================================================
--- trunk/mono/mono/dis/ChangeLog       2006-10-06 14:30:45 UTC (rev 66352)
+++ trunk/mono/mono/dis/ChangeLog       2006-10-06 14:35:22 UTC (rev 66353)
@@ -1,3 +1,8 @@
+2006-10-06  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * main.c (dis_directive_assembly): Fix the rendering of .locale to
+       be a data dump.
+
 2006-10-06  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * dump.c main.c: Applied patch from Jb. Allow dumping the PropertyPtr 
table.

Modified: trunk/mono/mono/dis/main.c
===================================================================
--- trunk/mono/mono/dis/main.c  2006-10-06 14:30:45 UTC (rev 66352)
+++ trunk/mono/mono/dis/main.c  2006-10-06 14:35:22 UTC (rev 66353)
@@ -183,9 +183,16 @@
                 cols [MONO_ASSEMBLY_HASH_ALG],
                 cols [MONO_ASSEMBLY_MAJOR_VERSION], cols 
[MONO_ASSEMBLY_MINOR_VERSION], 
                 cols [MONO_ASSEMBLY_BUILD_NUMBER], cols 
[MONO_ASSEMBLY_REV_NUMBER]);
-       if (cols [MONO_ASSEMBLY_CULTURE])
-               fprintf (output, "  .locale %s\n", mono_metadata_string_heap 
(m, cols [MONO_ASSEMBLY_CULTURE]));
-       if (cols [MONO_ASSEMBLY_PUBLIC_KEY]) {
+       if (cols [MONO_ASSEMBLY_CULTURE]){
+               const char *locale = mono_metadata_string_heap (m, cols 
[MONO_ASSEMBLY_CULTURE]);
+               glong items_read, items_written;
+               gunichar2 *render = g_utf8_to_utf16 (locale, strlen (locale), 
&items_read, &items_written, NULL);
+               char *dump = data_dump ((const char *) render, items_written * 
sizeof (gunichar2), "\t\t");
+               fprintf (output, "  .locale %s\n", dump);
+               g_free (dump);
+               g_free (render);
+               
+       } if (cols [MONO_ASSEMBLY_PUBLIC_KEY]) {
                const char* b = mono_metadata_blob_heap (m, cols 
[MONO_ASSEMBLY_PUBLIC_KEY]);
                int len = mono_metadata_decode_blob_size (b, &b);
                char *dump = data_dump (b, len, "\t\t");

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to