2006-10-06 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Fri, 6 Oct 2006 14:35:22 +0000 (14:35 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 6 Oct 2006 14:35:22 +0000 (14:35 -0000)
* main.c (dis_directive_assembly): Fix the rendering of .locale to
be a data dump.

svn path=/trunk/mono/; revision=66353

mono/dis/ChangeLog
mono/dis/main.c

index 54446d02902cd1edbaa90c9b8f1e6ef8c9e3db97..bbb6dc04074ee19a56193f2f933769e352ca589e 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-06  Miguel de Icaza  <miguel@novell.com>
+
+       * main.c (dis_directive_assembly): Fix the rendering of .locale to
+       be a data dump.
+
 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
 
        * dump.c main.c: Applied patch from Jb. Allow dumping the PropertyPtr table.
index 69a3bbc0eff7bb7c2eb5656e7dd3ccfbbfef9b9a..4413645ac3166c63888370536ed1e84b9fb7916f 100644 (file)
@@ -183,9 +183,16 @@ dis_directive_assembly (MonoImage *m)
                 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");