summary refs log tree commit diff
path: root/iconvdata/iso-2022-kr.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/iso-2022-kr.c')
-rw-r--r--iconvdata/iso-2022-kr.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/iconvdata/iso-2022-kr.c b/iconvdata/iso-2022-kr.c
index 69a1f5f89f..cb02cc9bf2 100644
--- a/iconvdata/iso-2022-kr.c
+++ b/iconvdata/iso-2022-kr.c
@@ -44,7 +44,18 @@
 #define MAX_NEEDED_TO		4
 #define PREPARE_LOOP \
   int save_set;								      \
-  int set = data->statep->count;
+  int set = data->statep->count;					      \
+  if (!FROM_DIRECTION && !data->internal_use && data->invocation_counter == 0)\
+    {									      \
+      /* Emit the designator sequence.  */				      \
+      if (outptr + 4 > outend)						      \
+	return GCONV_FULL_OUTPUT;					      \
+									      \
+      *outptr++ = '\x1b';						      \
+      *outptr++ = '\x24';						      \
+      *outptr++ = '\x29';						      \
+      *outptr++ = '\x43';						      \
+    }
 #define EXTRA_LOOP_ARGS		, set