Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1202

Already have UTF-8 in vsc (python) but stdout makes strange characters

$
0
0

This stdout doesn't work in UTF-8 as my Visual Studio Code and my computer (chcp 850)

 Estado de los medios. . . . . . . . . . . : medios desconectados   Sufijo DNS espec¡fico para la conexi¢n. . :   Descripci¢n . . . . . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter   Direcci¢n f¡sica. . . . . . . . . . . . . : E0-C2-64-64-FA-92   DHCP habilitado . . . . . . . . . . . . . : s¡   Configuraci¢n autom tica habilitada . . . : s¡

Code:

import subprocessdef ejecutar_comando(comando_Red):    resultado = subprocess.run(comando_Red, shell=True, capture_output=True, text=True)    return resultado.stdout.strip('UTF-8')comando_Red = ["ipconfig /all","getmac"]for comando_Red in comando_Red :    salida = ejecutar_comando(comando_Red)    print (salida)

I was expecting an UTF-8 output with things like í, á, ó, ú....my cmd and powershell work in chcp 850 and show proper Latin characters.


Viewing all articles
Browse latest Browse all 1202

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>