Characterset in Sourcetree

Having trouble with sourcetree-bitbucket-git, and charactersets.
Default in sourcetree is utf-8,  under "repo settings"

if I try to commit a file that is windows-1252 format (latin1, iso-8859-1 etc), which contains norwegian characters (æ, ø, å) then in the view where you select "hunk" to stage:

image2016-8-16 11:9:30.png

those black dots should be å, and I get this error message:

Error encountered
'git apply' failed with code 1: Checking patch xxx/file.sql...
error: while searching for:
xxx uniqueidentifier,
xx uniqueidentifier,
xxx int NULL,
DRGGrupperingAvslutningsm�te varchar(1) NOT NULL,
xxx int NULL,
xxx bit NOT NULL,
xxx bit NOT NULL,

error: patch failed: xxx/file.sql:15
error: xxx/file.sql: patch does not apply

See C:\Users\xxxx\AppData\Local\Atlassian\SourceTree\LastFailedPatch.txt for patch details (D:\xxx)

If I change to one of the other charactersets in the sourcetree config, then it looks ok in the window:

image2016-8-16 11:12:31.png

but I still get an error message, but now it seems like sourcetree is toying around with utf-16?

image2016-8-16 11:13:13.png

(you get two garbled characters where it should be one, typical for utf-16 rubbish)

If I convert the file to utf-8, then I get lots more errors on the other lines with text in the file that have these characters, so that is obviously no-go.

and now it starts to garble other text in sourcetree gui also, in the list of staged files:

image2016-8-16 11:15:31.png

the the tekst there should be NpkKjører, and in the commit log list it also does the same:

image2016-8-16 11:16:41.png

should read: "prøver å fikse.."

What on earth is going on here?

I had no problem uploading the whole repository with sourcetree, now It's impossible to commit code ?

Running the latest version,

Tested with system git, and embedded git, no difference.





1 answer

We are having the same issue with version on Windows 7.

How can we solve that?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

661 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot