[Github-comments] [geany/geany] Windows: Convert working directory to locale encoding before spawning commands (#1095)

Colomban Wendling notifications at xxxxx
Tue Jun 28 18:21:08 UTC 2016


> @@ -568,11 +571,52 @@ static gboolean spawn_async_with_pipes(const gchar *working_directory, const gch
>  		envp++;
>  	}
>  
> -	failure = spawn_create_process_with_pipes(command->str, working_directory,
> +	// convert working directory into locale encoding
> +	if (g_utf8_validate(working_directory, -1, NULL))
> +	{
> +		locale_working_directory = g_locale_from_utf8(working_directory, -1, NULL, NULL, &gerror);
> +		if (gerror) {
> +			/* TODO use the code below post-1.28 as it introduces a new string
> +			gchar *msg = g_strdup_printf(
> +				_("Failed to convert working directory into locale encoding: %s"), gerror->message);
> +			g_set_error_literal(error, gerror->domain, gerror->code, msg);

that's overly complex, cuold use the non-literal verison of `g_set_error()`

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1095/files/a95f174fe1ab0707c8fc092fceb9294cb92123b3#r68813257
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160628/4c72d710/attachment.html>


More information about the Github-comments mailing list