How to set the text encoding?

Mauro Molinari April 22, 2015

I'm new to BitBucket. I just created a repository and pushed some code. This code is encoded with ISO-8559-1 charset. However, when I browse it on BitBucket interface I see corrupted accented letters. I guess BitBucket assumes text files are in UTF-8 character encoding, but it's not my case.

How can I fix fhis? Is there an setting to tell BitBucket that text files in a repository are in a different encoding?

Is the "encoding" property of .gitattributes supported?

3 answers

1 accepted

3 votes
Answer accepted
Gary
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 14, 2015

Hi Mauro,

The Bitbucket website does default to UTF-8, and does not allow you to choose what encoding that the reader will try to view the repo with.  We have an open feature request to change this at https://bitbucket.org/site/master/issue/7239/allow-specifying-a-repositorys-encoding.  Please feel free to add any feedback, and/or vote for this feature.

Cheers,
Gary 

2 votes
Mauro Molinari May 14, 2015

Thank you Gary, I will monitor that ticket. This feature would be extremely useful, as UTF-8 is not the only encoding around sad

0 votes
Paul Sherman March 2, 2024

The answer Christopher gives is spot on. The problem with "unknown encoding" comes about when using Bitbucket online with slow internet connections -- such as mobile/cellular or ADSL. There is so much client-side activity, namely with google-analytics and cloudflare, that if you type the filename too fast, scripting code hasn't loaded yet to recognize the formats of the filename and/or extension you type.

Christopher (and, later, I) suggest this flow:
1. After selecting ... / Add file, wait a moment for page to load completeley
2. Delete any character(s) from the filename
3. Re-type the deleted characters

Root-cause fix: Please REMOVE all the google-analytics.

Suggestion: After commit, please go to the Source screen rather than the Commits screen, because the Commits screen does not have the ... menu and it takes one more click and page load (slow) to add the next file. Handy, for when you're adding a bunch of new files in a sitting.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events