Sublime Forum

ST3: Problem with encoding

#1

I am currently using Sublime Text 3 for coding, and while most works as desired, I have seen one major draw back from Sublime Text 2. When opening a file, in an odd character set (at work we use IBM-858, yes it is suboptimal). When opening a file in this characterset, and simply saving it, special characters are corrupted, even though no content was changed. See screenshot below:

http://imageplay.net/img/tya22320953/stbug.png

When doing the same thing in Sublime Text 2, the content is the same as before the save, which is what one would expect. Both report the file as being in the format Windows-1252, which I guess is what comes closest to IBM-858. It works in Sublime Text 2, but not in Sublime Text 3. Fallback encoding in both versions is the same:

"fallback_encoding": "Western (Windows 1252)",

Is there a solution to this, or is this a bug?

0 Likes

#2

Strange behavior…

What’s the content of the console when you open and save the file ?
You must have something like:

Unable to auto detect encoding, using fallback encoding Western (Windows 1252) Writing file /D/PP/TOTO.txt with encoding Western (Windows 1252)

0 Likes

#3

In ST3 the output in the console is:

Unable to auto detect encoding, using fallback encoding Western (Windows 1252)
Writing file /…/test.txt with encoding Western (Windows 1252) (atomic)

In ST2:

Unable to auto detect encoding, using fallback encoding Western (Windows 1252)
Writing file /…/test.txt with encoding Western (Windows 1252)

0 Likes

#4

I found out that disabling atomic save in ST3, fixed the problem, I am even able to add new special characters in between existing ones without any problems. The question is then, why does it not work with atomic save enabled? is this a bug in the atomic save function? it looks like it to me.

0 Likes

#5

I hope this gets resolved at some point :frowning:

0 Likes

#6

It looks like atomic save cause lot of troubles:
http://www.sublimetext.com/forum/viewtopic.php?f=3&t=12660&start=0
It’s probably better to let it disabled.

But actually I don’t understand why it change the char. encoding of the file.
It must probably be a bug, there’s no reason for this different behavior.

0 Likes

Why is atomic save useful?
#7

Hi, which platform are you using? What special characters are you trying to save? This would help us to replicate the issue. Thanks.

0 Likes

#8

Hello,

This is an old topic but i have the same problem and think i have fixed it.
The auto detect only find ASCII, UTF-8 and UTF-16 encodings, as written in the Settings-Default

So if your file is encoded with another one you may have the message.
Anyway you can change the default_encoding and the fallback_encoding in the Settings-User

0 Likes