Re: [PATCH] gitk branch name encoding utf-8 probrem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



加藤一博 <kato-k@xxxxxxxxxxxxx> writes:

> fix branch name encoding error on gitk.
>
> git checkout -b '漢字'
> gitk show branch name broken like this '貍「蟄'
> fix this problem.

Paul (the gitk maintainer), the patch text itself does look
reasonable.

    After "git checkout -b '漢字'" to create a branch with UTF-8
    character in it, "gitk" shows the branch name incorrectly, as it
    forgets to turns the bytes read from the "git show-ref" command
    into Unicode characters.

is how I would phrase the log message.

Thanks.

>
> Signed-off-by: Kazuhiro Kato <kato-k@xxxxxxxxxxxxx>
> ---
>  gitk | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/gitk b/gitk
> index abe4805..3f61a5b 100755
> --- a/gitk
> +++ b/gitk
> @@ -1780,11 +1780,15 @@ proc readrefs {} {
>      global otherrefids idotherrefs mainhead mainheadid
>      global selecthead selectheadid
>      global hideremotes
> +    global tclencoding
>  
>      foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
>  	unset -nocomplain $v
>      }
>      set refd [open [list | git show-ref -d] r]
> +    if {$tclencoding != {}} {
> +	fconfigure $refd -encoding $tclencoding
> +    }
>      while {[gets $refd line] >= 0} {
>  	if {[string index $line 40] ne " "} continue
>  	set id [string range $line 0 39]
> --
>
> See this pull request
> https://github.com/kkato233/gitk/pull/4
>
> -----Original Message-----
> From: Jonathan Nieder <jrnieder@xxxxxxxxx> 
> Sent: Thursday, December 5, 2019 7:29 AM
> To: 加藤一博 <kato-k@xxxxxxxxxxxxx>
> Cc: git@xxxxxxxxxxxxxxx; Paul Mackerras <paulus@xxxxxxxxxx>
> Subject: Re: [PATCH] gitk branch name encoding utf-8 probrem
>
> (cc-ing Paul, gitk expert)
> Hi!
>
> 加藤一博 wrote:
>
>> Here is a patch to gitk branch name utf-8 probrem.
>
> Thanks for reporting it.  Can you provide a short summary here of
> the problem that we can use for a self-contained description in the
> commit log?  See
> https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#describe-changes
> for more on this subject.
>
> May we also have your sign-off?  See
> https://www.kernel.org/pub/software/scm/git/docs/SubmittingPatches.html#sign-off
> for what this means.
>
> Thanks and hope that helps,
> Jonathan
>
>> See issue
>> https://github.com/kkato233/gitk/issues/1
>> and fix it 
>> https://github.com/kkato233/gitk/pull/2
>> 
>> 
>> ---
>> 
>> diff --git a/gitk b/gitk
>> index abe4805..3f61a5b 100755
>> --- a/gitk
>> +++ b/gitk
>> @@ -1780,11 +1780,15 @@ proc readrefs {} {
>>      global otherrefids idotherrefs mainhead mainheadid
>>      global selecthead selectheadid
>>      global hideremotes
>> +    global tclencoding
>> 
>>      foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
>>         unset -nocomplain $v
>>      }
>>      set refd [open [list | git show-ref -d] r]
>> +    if {$tclencoding != {}} {
>> +       fconfigure $refd -encoding $tclencoding
>> +    }
>>      while {[gets $refd line] >= 0} {
>>         if {[string index $line 40] ne " "} continue
>>         set id [string range $line 0 39]




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux