+ if (CODING_REQUIRE_ENCODING (proc_encode_coding_system[outchannel]))
+ {
+ /* Here we encode arguments by the coding system used for
+ sending data to the process. We don't support using
+ different coding systems for encoding arguments and for
+ encoding data sent to the process. */
+ struct gcpro gcpro1;
+ int i = 1;
+ struct coding_system *coding = proc_encode_coding_system[outchannel];
+
+ coding->mode |= CODING_MODE_LAST_BLOCK;
+ GCPRO1 (process);
+ while (new_argv[i] != 0)
+ {
+ int len = strlen (new_argv[i]);
+ int size = encoding_buffer_size (coding, len);
+ unsigned char *buf = (unsigned char *) alloca (size);
+
+ encode_coding (coding, new_argv[i], buf, len, size);
+ buf[coding->produced] = 0;
+ /* We don't have to free new_argv[i] because it points to a
+ Lisp string given as an argument to `start-process'. */
+ new_argv[i++] = buf;
+ }
+ UNGCPRO;
+ coding->mode &= ~CODING_MODE_LAST_BLOCK;
+ }
+