Skip to content
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

The sample code, opened at first start is ASCII, should be UTF-8 #381

Open
LightTemplar opened this issue Nov 17, 2022 · 1 comment
Open

Comments

@LightTemplar
Copy link

LightTemplar commented Nov 17, 2022

  1. I installed cq-editor and cadquery
  2. started cq-editor for the first time
  3. it showed me some sample code.
  4. I changed it, added some symbols in my native language as comment
  5. and tried to save.
  6. CQ-Editor threw an Error:
[2022-11-17 03:24:43.249238] ERROR: CQ-Editor: Uncaught exception occurred
Traceback (most recent call last):
  File "/home/alexander/Applications/anaconda3/envs/cad/lib/python3.10/site-packages/cq_editor/widgets/editor.py", line 180, in save
    encoded = self.toPlainText().encode(encoding)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 144-147: ordinal not in range(128)

If I do the same in a new file, it works without such problem.

I suppose, it's because this first sample code was in ASCII, but should be in UTF-8 encoding, according to #356

App Version

Using Version: 0.3.0dev. installed via Conda, as described in the Documentation.

@LightTemplar
Copy link
Author

I have experimented a little and found exact behavior:
If I create a new file, write there some non-Latin symbols and save it - it saves correctly. And I can successfully edit it also further. But, If I create a new file, write there only Latin symbols, save it and then try to add non-Latin symbols, I get exact this error.
So, I think, #356 doesn't work and #276 isn't solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant