Skip to content

Confusing diff when changing file encoding #16329

Closed
@jpraet

Description

@jpraet

Description

I have commits that change the encoding of files from Windows Cp1252 encoding to UTF-8.

In Gitea, the diff makes it look like the special characters get converted incorrectly.

https://try.gitea.io/jpraet/encoding/commit/7d1a5559f40bb2520c42d08c9508c2e5d82d98d5
afbeelding

When viewing the new file, it is displayed correctly as UTF-8 though.

https://try.gitea.io/jpraet/encoding/src/commit/7d1a5559f40bb2520c42d08c9508c2e5d82d98d5/test.txt
afbeelding

On GitHub, it looks like this: jpraet/encoding@7d1a555

afbeelding

Git diff output:
afbeelding

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions