Sublime Forum

On the garbled code problem of ConvertToUTF8 Saving

#1

For some reasons, I need to use non utf8 encoding and install the ConvertToUTF8 plug-in, but there are still garbled codes when saving from time to time. Is there any solution? Because it could lead to a full rewrite at any time…

PS:This is a problem caused by the cache refresh rate. Modifying the refresh parameters can reduce the accident rate, but it can not be completely eradicated. Is there a better way?

0 Likes

#2

Why not use File > Save with Encoding > UTF-8 to do encoding conversion?

0 Likes

#3

Enmmm…
Because the final running environment requires GBK encoded files,it can not use utf8 …~(e)~…

0 Likes

#4

Have you installed the Codecs33 package, as suggested by the ConverToUTF8 plugin: https://github.com/seanliang/ConvertToUTF8 ?

0 Likes

#5

Yes, that’s what I did. It was a bug caused by the ConverToUTF8 plug-in.It happens occasionally, but sometimes it’s very destructive

0 Likes

#6

To enforce a non-UTF-8 encoding you need to edit the settings of your language and change both the default encoding as well as the fallback encoding to the desired encoding. Example, assuming you wanted to enforce ISO-8859-1:

    "default_encoding":  "Western (ISO 8859-1)",
    "fallback_encoding": "Western (ISO 8859-1)",

The fallback setting will prevent attempts from the editor to revert to UTF-8.

Beware that pasting operations can still break the encoding because the clipboard is not converted to the target encoding, but at least you’ll get a warning with these settings when this happens.

0 Likes

#7

ヾ(❀╹◡╹)ノ~
Thank you very much.

0 Likes