stash can not view source file encoding by gbk ?

smith February 19, 2013

My source file include some chinese chars, and those chinese chars encoding by gbk not utf-8, when view source in stash, chinese chars not correct display,and also diff。anyone help me? thanks。

1 answer

0 votes
Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 20, 2013

Smith Xin,

Stash relies on heuristics to detect the codepage for source files, when viewing source. It has been tested with GB18030-encoded files, but it appears there are other encodings that are also referred to as "GBK". The easiest way for us to help you would be for you to raise a support request at support.atlassian.com. Then perhaps you can share a simple, GBK-encoded file with us so we can include it in our testing. That would at least help us get it working for viewing source.

Diffs, unfortunately, are another story. git diff internally only understands UTF-8. Any other format is viewed as binary and cannot be diffed. To diff files in other encodings, an external diff tool must be used. Stash does not do this, nor does it support it. You may want to open a new feature request on jira.atlassian.com so that it can be voted on, and to keep it on our radar.

Full support for international character sets is not a current Stash feature. It is something that has been discussed, but has taken a backseat to other features like pull requests, hooks and forks. Raising an issue and voting for it helps us gauge how important the feature is to customers, and potential customers.

Sorry I can't be more help! If you do raise an issue at support.atlassian.com, or jira.atlassian.com, you might reference this question there to help us link the two.

Best regards,
Bryan Turner

smith February 20, 2013

Bryan Turner,

Thank you very much,but as far as I know the gbk is a subset of GB18030, it should to be correct display,if any configuration i can set?

Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 20, 2013

Unfortunately, no, there are no configuration settings. Stash performs its heuristic detection and, if that fails, falls back on UTF-8. As I noted, international character sets are not a feature of the current system. They're best-effort detection.

If you're willing to attach a file in your encoding (you can even attach one to this Answers question), I'll take a look and see if I can at least get the detection on the source view to work. If so, I'll try to get my fixes for that included in 2.2.

Best regards,
Bryan Turner

smith February 20, 2013

Bryan Turner,

Thansks, when I prepaire the sample file encoding by gbk ,I found the (README.txt) can display well,but the README-gbk.txt not ,It's only a line. why?

smith February 20, 2013

attach (README-gbk.txt) for up .

smith February 20, 2013

Bryan Turner,

Thank you for your help, I understand the file must have enough chars to to detect the codepage for source file,It should be work in most of files。 thank you very much !

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events