seanliang / ConvertToUTF8

A Sublime Text 2 & 3 plugin for editing and saving files encoded in GBK, BIG5, EUC-KR, EUC-JP, Shift_JIS, etc.
https://github.com/seanliang/ConvertToUTF8
MIT License
900 stars 178 forks source link

Does not work with Apple M1/M2-based system with Sublime 4 #99

Open tzchang opened 1 year ago

tzchang commented 1 year ago

With 1.2.14 and Sublime Text 3, under Apple M1/M2, it is working.

However, if update to Sublime Text 4, this package no longer works.

Error message when try to save a file with encoding set to BIG5.

reloading /Users/achang/Downloads/test.txt
unable to auto detect encoding for ~/Downloads/test.txt, using fallback encoding Western (Windows 1252)
Traceback (most recent call last):
  File "/Users/achang/Library/Application Support/Sublime Text 3/Packages/ConvertToUTF8/ConvertToUTF8.py", line 784, in <lambda>
    sublime.set_timeout(lambda: self.undo_me(view), 0)
  File "/Users/achang/Library/Application Support/Sublime Text 3/Packages/ConvertToUTF8/ConvertToUTF8.py", line 809, in undo_me
    view.set_reference_document(view.settings().get('origin_content'))
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime.py", line 2610, in set_reference_document
    sublime_api.view_set_reference_document(self.view_id, reference)
TypeError: String required
seanliang commented 1 year ago

Thank you for your bug report, this message only appears when a newly created file is saved, and it doesn't affect the encoding process. I'll fix it in the next release.