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

[BUG] Chunks of text go missing when writing Asian text (wrapping issue) #3176

Closed
darrenburns opened this issue Oct 30, 2023 · 1 comment · Fixed by #3180
Closed

[BUG] Chunks of text go missing when writing Asian text (wrapping issue) #3176

darrenburns opened this issue Oct 30, 2023 · 1 comment · Fixed by #3180
Assignees
Labels
bug Something isn't working

Comments

@darrenburns
Copy link
Member

Description

(Originally reported in Textual: Textualize/textual#3567)

When you print Asian text (specifically Chinese and Japanese, which do not use spaces), portions of the text go missing, making it unreadable.

This seems to be related to wrapping, as the characters which go missing are at the end of a line.
Instead of being wrapped on to a new line, they disappear.

There are rules for wrapping in these languages which would take more effort to adhere to, but at the very least, text should not go missing when printed.

Examples

For example, running the snippet below, the 7 in 1670 disappears:

from rich.console import Console
console = Console(width=20)
console.print("アプリケーションは1670万色を使用でき")

Output:

アプリケーションは16
0万色を使用でき

And in many cases, like those reported in this issue, multiple characters disappear:

from rich.console import Console
console = Console(width=20)
console.print("TextualはPythonの高速アプリケーション開発フレームワークです")

Output:

TextualはPy
thonの高速アプリ
ケーション開発フレー

Notice that many of the characters at the end of the text are completely missing (ムワークです).

Copy link

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant