Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

not able to edit files in bitbucket directly

anil kumar K July 13, 2021

Hello,

If i try to edit file directly from the web I'm getting following error

"Failed to detect original file encoding. Cannot save commit with unknown encoding"

 

I renamed file name from test-file to testfile. Still getting same error. Please help me to resolve it.

1 answer

0 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2021

Hi, @anil kumar K! Welcome to the community! 

Just to give you some context around this behavior, Bitbucket tries to guess a file's encoding and, when it fails, issues like this may arise. 

We already have a feature request to allow users to specify the encoding for a repository, which I believe would solve issues like this: 

I've linked your question to this feature. Please consider adding yourself as a watcher, this way you get updated as we make progress with this. 

If you are not familiar with our Feature Request Policy, you can read more about it here.

With that said, could you confirm what encoding you are using for this specific file? 

One suggestion would be to use utf-8 encoding for this file, if possible (e.g. if you use different encoding because you want to use e.g. Japanese characters, this won't be a feasible solution I guess). If it's ok for you to use utf-8, you can try deleting this file, and create a new one (with the contents of the deleted) and make sure it uses utf-8 encoding. Commit and push it to Bitbucket. Then please let me know if editing it online works for you.

I hope this helps, but please let me know if you face any obstacles. 

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events