hedyhli / starcli

:sparkles: Browse trending GitHub projects from your command line
https://pypi.org/project/starcli/
MIT License
550 stars 50 forks source link

Textwrap problems for chinese characters #46

Closed hedyhli closed 4 years ago

hedyhli commented 4 years ago
starcli-chi

English seems to be working fine, but looks like textwrap has some problems for Chinese description, and the code that causes it is here: https://github.com/hedythedev/starcli/blob/503adecbe49db9e5f035983a1820d79a4f4a8f2f/starcli/layouts.py#L83-L90

rich.text can help with Chinese characters wrapping

willmcgugan commented 4 years ago

Yeah, the Text class will handle that. The standard library doesn’t account for Asian character widths, or Emojis.

hedyhli commented 4 years ago

Got it, thanks!