git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-gui--askpass: coerce answers to UTF-8 on Windows

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2020, 20:17 UTC
Message-ID
<xmqqa74mhcjb.fsf@gitster.c.googlers.com>
In-Reply-To
<pull.578.git.1583954676691.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 10 quoted lines
> diff --git a/git-gui--askpass b/git-gui--askpass
> index 4277f30c411..b0704e6d91e 100755
> --- a/git-gui--askpass
> +++ b/git-gui--askpass
> @@ -56,6 +56,11 @@ proc finish {} {
>  		}
>  	}
>  
> +	# On Windows, force the encoding to UTF-8: it is what `git.exe` expects
> +		if {$::tcl_platform(platform) eq {windows}} {
The indentation looks funny here.  Dedent one level?
> +		set ::answer [encoding convertto utf-8 $::answer]
> +	}

Looks correct (assuming that $::answer we got is Unicode "string", and I think that is a sane assumpton as it came directly from a textvariable bound to an entry widget).

Show 5 quoted lines
>  	puts $::answer
>  	set ::rc 0
>  }
>
> base-commit: 63a58457e094c9c9bbf562b872009d32f1f88133
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 2 of 5 in “git-gui--askpass: coerce answers to UTF-8 on Windows”
  1. git-gui--askpass: coerce answers to UTF-8 on WindowsJohannes Schindelin via GitGitGadget, Mar 11, 2020
  2. Junio C HamanoMar 11, 2020
  3. git-gui--askpass: coerce answers to UTF-8 on WindowsJohannes Schindelin via GitGitGadget, Mar 12, 2020
  4. Junio C HamanoMar 13, 2020
  5. Pratyush YadavMar 14, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.