jesseduffield / jesseduffield/lazygit

Can't show accented characters on non utf-8 files

Open
#2,510 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Describe the bug**
When the content of the file shown on previews is not utf-8, accented characters are not shown.

**To Reproduce**

1. In a git repository create a text file.
2. Editing the file in vim, add a string with accent characters like "acentuação"
3. `:set fileencoding=latin1`
4. Save the file.
5. Open lazygit

**Expected behavior**
Accented characters should display corretcly.

**Screenshots**
utf-8:
![image](https://user-images.githubusercontent.com/5962898/226040660-5ad037e6-5d87-4f42-b8fb-fe655144fe4b.png)

latin1:
![image](https://user-images.githubusercontent.com/5962898/226040808-4a0c9069-8f11-42a1-b43d-52d5ecd77fe0.png)

**Version info:**
- commit=16802a048e0425182f08cf0e9a2bc31480e9a55d, build date=2023-02-01T11:02:43Z, build source=binaryRelease, version=0.37.0, os=linux, arch=amd64, git version=2.39.2
- git version 2.39.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.