admin管理员组文章数量:1432613
My file setting in VS Code is set to UTF-8 (default) rendering. If I run my line via Shift+Enter, the python Native REPL opens but i get the wrong encoding as i show below. However, If i run using the interactive window (jupyter) or via the terminal I get the correct rendering.
example code:
print('Accented letters: á, é, í, ó, ú, ü, ñ')
I get this wrong output as follows:
Accented letters: á, é, Ã, ó, ú, ü, ñ
My file setting in VS Code is set to UTF-8 (default) rendering. If I run my line via Shift+Enter, the python Native REPL opens but i get the wrong encoding as i show below. However, If i run using the interactive window (jupyter) or via the terminal I get the correct rendering.
example code:
print('Accented letters: á, é, í, ó, ú, ü, ñ')
I get this wrong output as follows:
Accented letters: á, é, Ã, ó, ú, ü, ñ
Share
Improve this question
edited Nov 20, 2024 at 23:15
Ash
asked Nov 18, 2024 at 20:18
AshAsh
315 bronze badges
6
|
Show 1 more comment
1 Answer
Reset to default 0set the REPL encoding to utf-8?
The code below works for me:
print(('Accented letters: á, é, í, ó, ú, ü, ñ').encode('cp1252').decode('utf-8'))
本文标签: Why does VS Codes39s Python REPL window output letters with wrong encodingStack Overflow
版权声明:本文标题:Why does VS Codes's Python REPL window output letters with wrong encoding? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745596553a2665516.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
.ipynb
files and the# %%
cell notation are working fine for me. Can you provide more debugging steps? – Anerdw Commented Nov 19, 2024 at 0:08