File encoding change after commit (OD-82)
bufferUnderrun opened 6 years ago

Hi,

After a commit in onedev, the file encoding is changed from iso-8859-1 to utf8. 2020-04-02 12_36_47-OneDev - Super Easy All-in-One DevOps Platform.png2020-04-02 12_37_25-OneDev - Super Easy All-in-One DevOps Platform.png

So when doing a local diff, the patch is incorrect 2020-04-02 12_42_13-MINGW64__c_www_src_server.png

  • Robin Shen commented 6 years ago

    Looks like some special characters in the file causing OneDev believing it is of UTF-8 encoding. Can you please reproduce this issue with an example git repo and attach the repo zip for my diagnostics?

  • bufferUnderrun commented 6 years ago

    Thanks for your help.

    See the encoding.zip which contains the file above plus a git repo.

  • Robin Shen batch edited 6 years ago
    Name Previous Value Current Value
    Iterations
    empty
    3.0.11
  • Robin Shen commented 6 years ago

    Pushed your repo and changed the file same way, but OneDev is still detected encoding as ISO-8859-1. What browser are you using? Please also attach the repo after you've made the commit.

  • Robin Shen commented 6 years ago

    @bufferUnderrun please see my comments above. I hope to include the fix in 3.0.11 if possible.

  • bufferUnderrun commented 6 years ago

    I did not send the full file above 'AbsenceController.cs' but just a part. With that, i have not reproduce the issue too. I think it's because some specials characters (diacritic) where not in.

    In this test-repo.zip, i send your the full content of the file and reproduce the issue. In the last commit, i've just add "TEST" and it changes all other non ASCII char. The original AbsenceController.zip

  • Robin Shen commented 6 years ago

    Thanks for the info. It turns out to be a limitation when edit from browser, as browser always sends data in UTF8 format. For instance, github will also convert the encoding as UTF8 after editing a iso8859-1 file like below:

    Github 8859

    It is also suggested to use UTF-8 as default encoding for your source files in IDE, in order to play well with other tools.

  • Robin Shen changed state to 'Closed' 6 years ago
    Previous Value Current Value
    Open
    Closed
  • bufferUnderrun commented 6 years ago

    Thanks for your answer. I will convert all the file.

  • sususweet commented 1 year ago

    pr OD-55 will fix this issue.

  • Robin Shen referenced from other issue 1 year ago
issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
Not Found
Iterations
Issue Votes (0)
Watchers (3)
Reference
OD-82
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover