Streamlit: Encoding error

Created on 15 Oct 2019  路  3Comments  路  Source: streamlit/streamlit

Code

# -*- coding: utf-8 -*-
import streamlit as st

import sys
import numpy
import pandas


st.title("Test russian: 袪校小小袣袠袡")

st.write(sys.stdout.encoding)
st.write("Test russian: 褉褍褋褋泻懈泄")

Output:

image

Looks like Windows-1251 encoding X UTF-8

Debug info

Streamlit version: Streamlit, version 0.48.1
Python version: Python 3.7.4
Using Conda? PipEnv? PyEnv? Pex? = WinPython
OS version: Microsoft Windows 10
Browser version: Google Chrome 77.0.3865.90

Thanks!

bug cant_repro windows

Most helpful comment

workaround 2:
image

All 3 comments

workaround 1(for Windows with win-1251 default system encoding):
st.title(str("褉褍褋褋泻懈泄 褌械泻褋褌".encode('windows-1251'), 'utf-8'))
Well, it looks like this is a problem with encoding in Windows 10.

workaround 2:
image

Cannot reproduce on Windows 10 using streamlit 0.58.0 (latest) in Python 3.7. Closing due to the age of this bug.

Please open a new bug if a similar problem comes up.

Was this page helpful?
0 / 5 - 0 ratings