-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open .lsp files using windows1252 charset #240
Comments
@ext-pierre-etchemaite , thank you for reporting this issue and the workaround. Is it the lisp source code that can't be displayed correctly in the VS Code Editor? or file name / project name that can't be correctly displayed on the Project Panel on the left side? If you don't mind, would you please send out a sample file that's in problem? If it's in the Editor, the setting in the right-bottom cornor might help: Click on it, and a list of encodings will show up at the top area for us to select or search for: That's a capability of VS Code for us to manually override the encoding of the current document. |
I can't post any complete file, but few relevant lines should suffice: Problem concerns file content, not file names. And setting file encoding is exactly what I suggest to automate. |
I just noticed that setting LISPSYS does not only determines what editor is launched, but also switches AutoLisp Unicode support, or AutoLisp Unicode source code support. |
Yeah with LISPSYS=1, AutoCAD turns on the Unicode support for AutoLisp, and in this case, it invokes VS Code as the IDE, and VS Code will guess the encoding for each lisp file for rendering, because their encodings might be different. With LISPSYS=0, AutoCAD provides the legacy behavior for AutoLisp. If you work with lisp source files (.lsp) and don't need Unicode, both choices are fine. If you work with compiled lisp files, like .fas, which were previously compiled by a legacy version of AutoCAD, or compiled by the latest AutoCAD with LISPSYS=0, then it's better to set LISPSYS=0 to keep compatibility. |
@ext-pierre-etchemaite |
This extension forcing UTF-8 on all lisp files Line 276 in 40011d1
And when you use AutoCAD's VLISP editor, it uses Windows-1252, therefore VSCode doesn't properly display saved by VLISP settings:
And next time you edit that file in VSLISP, it won't be able read the settings and will save default settings again:
Current solution is change encoding in VSCode settings: I think this extension should not force file encoding at all. Let VSCode decide instead. |
I had character set issues opening .lsp files from a non-english project, that displays correctly in VLIDE (and prompts display correctly in AutoCAD console too, of course).
After some investigation, it seems the encoding used by those files, seldom mentionned as being "ANSI", is actually Windows 1252 encoding; And after some more investigation, I managed to make VS Code load those files correctly with some extra settings:
If my analysis is correct, and if it doesn't break anything, could the extension do that by default? Or at least document the problem and this possible solution.
The text was updated successfully, but these errors were encountered: