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'))
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745596554a4635150.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