Sublime Forum

Reopen with encoding - how can I add more?

#1

I need to reopen with GB2312 encoding, but the dialog in the bottom corner has no such encoding.

How can I add more to the list?

0 Likes

#2

Anyone? This is a critical feature needed @OdatNurd @kingkeith

0 Likes

#3

afaik you can’t - maybe just convert the file to standard UTF-8 and use that

0 Likes

#4

Is it by the design? Perhaps I can write a python plugin to do that?

0 Likes

#5

probably, give it a go
https://docs.python.org/3/library/codecs.html#standard-encodings

0 Likes

#6

There’s already some related plugins:

https://packagecontrol.io/search/GBK

1 Like

#7

Just made one https://github.com/CaledoniaProject/Sublime-EncodingConverter case closed :slight_smile:

0 Likes

#8

On linux/mac you can use the built-in iconv to convert your file to utf-8:

iconv -f GB2312 -t UTF-8 oldfile.txt -o newfile.txt
0 Likes

#9

I know that. I just need to work inside the editor

0 Likes

#10

Despite its name, the https://packagecontrol.io/packages/ConvertToUTF8 package should be able to help you:
https://github.com/seanliang/ConvertToUTF8/

0 Likes