From 90e58964956a270bd8494fd235c8b6dd88bc201a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Gl=C3=A4=C3=9Fle?= Date: Mon, 6 Jul 2015 16:17:29 +0200 Subject: [PATCH] Use binary IO channel for input_string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The channel encoding defines to which encoding the input string should be transformed before writing it to the channel. Since the in-memory encoding is always UTF-8 and the default encoding is also UTF-8, this is a NO-OP by default — except that it checks that all characters are valid UTF-8 characters. To avoid this check the encoding must be set to NULL (=binary). Note that the actual transformation (=NO-OP) remains the same. --- src/udisksspawnedjob.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/udisksspawnedjob.c b/src/udisksspawnedjob.c index f2aa8fc..ba8b2d4 100644 --- a/src/udisksspawnedjob.c +++ b/src/udisksspawnedjob.c @@ -531,6 +531,7 @@ udisks_spawned_job_constructed (GObject *object) if (job->child_stdin_fd != -1) { job->child_stdin_channel = g_io_channel_unix_new (job->child_stdin_fd); + g_io_channel_set_encoding (job->child_stdin_channel, NULL, NULL); g_io_channel_set_flags (job->child_stdin_channel, G_IO_FLAG_NONBLOCK, NULL); job->child_stdin_source = g_io_create_watch (job->child_stdin_channel, G_IO_OUT); g_source_set_callback (job->child_stdin_source, (GSourceFunc) write_child_stdin, job, NULL); -- 2.10.2