Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text artifacts left in "hello" demo #270

Open
LiamMW opened this issue Oct 4, 2019 · 6 comments
Open

Text artifacts left in "hello" demo #270

LiamMW opened this issue Oct 4, 2019 · 6 comments

Comments

@LiamMW
Copy link

@LiamMW LiamMW commented Oct 4, 2019

Summary

Some form of text corruption artefact on the the "hello" demo.

Steps to reproduce

What are the steps we should take to reproduce the bug:

  1. Running Windows 10
  2. Python 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 23:18:50) [MSC v.1900 64 bit (AMD64)] :: Anaconda, Inc. on win32
  3. run "streamlit hello"
  4. In the "choose a demo" drop down the default page is called 'â€"' and the title is 'Welcome to Streamlit! 👋'

Expected behavior:

Non corrupted text

Actual behavior:

In the "choose a demo" drop down the default page is called 'â€"' and the title is 'Welcome to Streamlit! 👋'

Is this a regression?

no

Debug info

  • Streamlit version: (get it with $ streamlit version) = Streamlit, version 0.47.3
  • Python version: (get it with $ python --version) = Python 3.7.3
  • Using Conda? PipEnv? PyEnv? Pex? = Conda
  • OS version: Microsoft Windows 10 Pro (Version 10.0.18362 Build 18362)
  • Browser version: Google Chrome 77.0.3865.90 (Official Build) (64-bit)

image

@LiamMW LiamMW added the bug label Oct 4, 2019
@tvst

This comment has been minimized.

Copy link
Collaborator

@tvst tvst commented Oct 5, 2019

Hi LiamMW

I just noticed this the other day too, when testing on a Windows VM.

This looks like a Python Unicode issue. We'll have to do some research to find the right solution here, but it would be great if someone with more Windows experience could chip in.

@swayson

This comment has been minimized.

Copy link

@swayson swayson commented Oct 11, 2019

I have seen those weird symbols before. I think its because its often the case in Windows that the default encoding is latin-1 instead of UTF-8.

@swayson

This comment has been minimized.

Copy link

@swayson swayson commented Oct 11, 2019

Not sure if we want to include new dependencies, but I see there are a few issues relating to encoding.

A bit of a brute force approach to solving those issues that has worked well in the past, if you have a broad user base is called; ftfy (fix text for you). Perhaps this could be handy for streamlit?

https://github.com/LuminosoInsight/python-ftfy

@tvst

This comment has been minimized.

Copy link
Collaborator

@tvst tvst commented Oct 14, 2019

Oh, that's an interesting Python module. As you say, we should be judicious about adding dependencies, so let's see if we can solve this without that. But that's a good candidate in case we have no recourse 👍

Can someone try this on Windows? (As luck would have it, my Windows machine just broke...)

  1. st.write('Using unescaped unicode: 👍')
  2. st.write('Using escaped unicode: \U0001F44D')
  3. st.write(u'Using unescaped unicode and explicit unicode literal: 👍')
  4. st.write(u'Using escaped unicode and explicit unicode literal: \U0001F44D')

Do any of these print correctly?

(If no response after I'm done triaging all pending issues, I'll download and run a Windows VM to try this out myself)

@swayson

This comment has been minimized.

Copy link

@swayson swayson commented Oct 14, 2019

I'll give it a test later today and let you know.

@nabhanabdulla

This comment has been minimized.

Copy link

@nabhanabdulla nabhanabdulla commented Oct 19, 2019

Hi @tvst , I use windows machine and is getting similar output on running the demo. These are the outputs I got

  1. st.write('Using unescaped unicode: 👍')

Script execution error(popup window) - 'charmap' codec can't decode byte 0x8d in position 65: character maps to

  1. st.write('Using escaped unicode: \U0001F44D')

Using escaped unicode: 👍

  1. st.write(u'Using unescaped unicode and explicit unicode literal: 👍')

Script execution error(popup window) - 'charmap' codec can't decode byte 0x8d in position 95: character maps to

  1. st.write(u'Using escaped unicode and explicit unicode literal: \U0001F44D')

Using escaped unicode and explicit unicode literal: 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.