JetpackDuba / Gitnuro

A FOSS Git multiplatform client for newbies and pros

Home Page:https://gitnuro.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discard hunk will reformat file and turn some none ascii chars to ?

vt107 opened this issue · comments

Describe the bug
Discard hunk will reformat file and turn some none ascii chars to ?
Example:
Trang Chủ -> Trang Ch?
Giới Thiệu -> Gi?i Thi?u

To Reproduce
Steps to reproduce the behavior:

  1. Commit any file that has Vietnamese text inside (example: Trang Chủ )
  2. Edit some other place in that file, then open GitNuro and click Discard Change one place
  3. See error: Trang Chủ -> Trang Ch? in the step 1

Expected behavior
Discard will discard only the part that we want to discard

Desktop (please complete the following information):

  • OS: Ubuntu 22
  • GitNuro Version: 1.2.1 (1.3.0 has error when pull with ssh so I have to use v1.2.1)

Hey! Weird, I have not been able to reproduce it in 1.3.0 nor 1.2.1. Can you perhaps record a video (just image, no need for sound if you don't want to) showing the exact steps to reproduce the issue in case I've missed something?

@JetpackDuba thanks for your response, please check the video below:
https://gemoo.com/tools/upload-video/share/570390935085330432?codeId=Pa6qL9ln40gn6&card=570390931138490368

If there is some viernamese text inside that file from previous commit, then we edit another part and discard hunk using GitNuro, some chars will be replaced with ?

Thank you @vt107 ! I'm not sure why I can't reproduce it in my PC (Archlinux), I've even tried with japenese, arabic and russian characters but it works just fine. I'll do some tests in Windows, Ubuntu (VM) and MacOS (VM) to see if something similar happens.

Could you please test it on 1.3.1? Just in case compose changes something and it was somehow fixed, wouldn't be the first time (Korean had a similar issue in the past).

Thank you ! I'm not sure why I can't reproduce it in my PC (Archlinux), I've even tried with japenese, arabic and russian characters but it works just fine. I'll do some tests in Windows, Ubuntu (VM) and MacOS (VM) to see if something similar happens.

@JetpackDuba, In Chinese, I found my file (save in UTF-8) will be saved to GB2312(default Chinese encode on Windows) when partly stage by Gitnuro. And this will make Chinese charaters become ?. I think it may cause same problem on other language.

Aha! That's some nice info there! I think I know what could be wrong, I'll look into it.