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

Unicode emojis #61

Open
ArneBachmann opened this issue Jun 3, 2018 · 1 comment
Open

Unicode emojis #61

ArneBachmann opened this issue Jun 3, 2018 · 1 comment

Comments

@ArneBachmann
Copy link
Contributor

Be aware, that high unicode codepoints are not available in many fonts. Try to stick to 16bit codepoints to achieve better compatibility.

Here are the values I use in one if my Python projects:

# first list is ASCII, second is 16bit unicode, third list has some more exotic symbols
PROGRESS_MARKER:List[str] =  ["|/-\\", "\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588\u2587\u2586\u2585\u2584\u2583\u2582", "\U0001f55b\U0001f550\U0001f551\U0001f552\U0001f553\U0001f554\U0001f555\U0001f556\U0001f557\U0001f558\U0001f559\U0001f55a\U0001f559\U0001f558\U0001f557\U0001f556\U0001f555\U0001f554\U0001f553\U0001f552\U0001f551\U0001f550"] 
DOT_SYMBOL:str = "\u00b7"
MULT_SYMBOL:str = "\u00d7"
CROSS_SYMBOL:str = "\u2716"
CHECKMARK_SYMBOL:str = "\u2714"
PLUSMINUS_SYMBOL:str = "\u00b1"  # alternative for "~"
ARROW_SYMBOL:str = "\u2799"  # alternative for "*"
MOVE_SYMBOL:str = "\u21cc"  # alternative for "#". or use \U0001F5C0", which is very unlikely to be in any console font

In addition, not all shells/consoles are set to unicode.
E.g. Windows 7 you need to call chcp 65001 to enable unicode, or do some registry hacks to enable it by default. On Linux, I guess utf-8 has been standard for at least 10 years in most if not all distributions. Not sure about Windows 10 or Powershell defaults.

@erikbern
Copy link
Owner

erikbern commented Jun 4, 2018

sure, maybe #58 was a bit unnecessary.

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

No branches or pull requests

2 participants