http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52539

--- Comment #6 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Patch part 1:

Index: write.c
===================================================================
--- write.c    (revision 208887)
+++ write.c    (working copy)
@@ -1835,7 +1835,10 @@
               break;

         case BT_CHARACTER:
-          write_character (dtp, p, 1, obj->string_length, DELIM);
+          if (dtp->u.p.current_unit->flags.encoding == ENCODING_UTF8)
+        write_character (dtp, p, 4, obj->string_length, DELIM);
+          else
+        write_character (dtp, p, 1, obj->string_length, DELIM);
               break;

         case BT_REAL:

Results:

 Write to terminal just the strings:
>a你好<
 >a你好<
 Write to the terminal the namelist:
&NML
 STR="a你好",
 /

Reply via email to