coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.38k stars 431 forks source link

The automatic encoding guessing feature in Windows BAT/VBS file may guess wrong language. #1512

Closed wbsdty331 closed 1 year ago

wbsdty331 commented 1 year ago

Description

I have several Windows BAT/VBS files that contain Chinese characters. However, when I open them with CotEditor, the encoding is guessed as Japanese (EUC、ISO 2022-JP and so on). so I have to manually switch to Simplified Chinese (GB2312) every time.

image

demo file: demofile.zip

To Reproduce

just use CotEditor to open these files.

Expected behavior

CotEditor should guess the correct encoding for these file , like vscode: image

CotEditor version

4.5.8

macOS version

13.5.1

Additional context

No response

1024jp commented 1 year ago

This is not a bug. Sometimes, a file can be decoded with multiple file encodings, leaving aside whether the encoding is correct for humans.

CotEditor is capable of customizing the priority of file encodings for encoding detection. Go to the Format settings pane, press the Edit List button for the priority of encodings, and drag the encodings in the list to make encodings of your language higher than Japanese ones.

Screenshot 2023-08-29 at 22 50 27
wbsdty331 commented 1 year ago

Thank you very much!