spcl / spcl/dace

Compiler.py (utf-8) cannot handle Chinese '.Net information' output

Open
#1,157 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
593
Forks
163
Avg merge
2d 23h
Merged PRs (30d)
60

Description

**Describe the bug**
If the user has installed the Chinese version of Visual Studio, it may occur an error when running the "Getting Started" program.
In the file "getting_started.ipynb", when run at `"getstarted(a)"`, error occurs:
"UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 0: invalid continuation byte"
I think the reason of this bug is not concerning the Chinese character's output.
error line is:
`output.write(line.decode('utf-8') + '\n')`
I replace all these statements by:
`output.write(line.decode('gbk') + '\n')`
Then the error is solved.
This is only a temporary change. Maybe` try/catch `is a better choice.

**To Reproduce**
Steps to reproduce the behavior:
1. run getting_started.ipynb
2. See error

**Expected behavior**
no error occurs.

**Screenshots**
![1669267288126](https://user-images.githubusercontent.com/38322329/203700588-00f963d4-afda-443f-9609-94f272b170ee.png)

**Desktop (please complete the following information):**
- OS: Windos
- Browser: chrome
- Version: 106.0.52

**Additional context**
Although language errors are not a problem with Dace itself, it is hoped that developers will implement adaptable decoding for different language encoding formats.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.