-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Error in Table style updation using box #125
Comments
I guess you're on Windows? The box setting is ignored on Windows because cmd.exe doesn't render most unicode box characters. But that shouldn't apply to Jupyter, so I will change the logic there. In the meantime, if you set |
Please give v2.3.1 a try. |
@willmcgugan Thanks it's working now. But I wanted to use that for windows legacy terminal but it wasn't working so I tried that on Jupyter. I want to use Table on legacy windows. Can you recommend the box style that will surely work on cmd? I guess box.ASCII can be an option but I'm open for other suggestions. |
Most of the unicode box characters don't render on windows legacy. Any of the heavy / double / rounded characters display as question marks. Rather than have a situation where a table looks good on OSX / Linux / Window Terminal but garbage on Windows legacy, I set the box parameter to But that does mean you can't select |
Did some more digging, and it turns out that it's not cmd.exe that doesn't support box characters, its the choice of font. The raster fonts are missing some box characters, but the truetype fonts look fine. It's a bit of a dilemma. There is no way to detect the user's choice of font. I'll need to think about that one, but it does look like I can support a greater range of box characters on Windows in a future update. |
Actually I was testing that on github actions and clearly windows on GitHub Actions don't support unicode. My application is basically cross platform and I need to check if my build pass on both the system. But I don't want to drop the beautiful table on windows where users have terminal that support unicode. So I'm handling that with a try except block that, if I can write and I don't get UnicodeEncode error I can print the unicode table but if I can't I'll switch table to use box.ASCII which is supported by CI. Do you have any other better implementation ? |
Github Actions should support unicode output, but I think you will need to set the PYTHONIOENCODING environment variable to "utf-8". As far as tests goes, you might want to set I think perhaps the solution to box characters on windows is to set a different default for Windows, but allow that to be modified in the Table constructor. |
Version 3.0.0 has support for more box characters on legacy Windows. By default it will substitute any unsafe box characters, but you can override this with a new Run the following to see how the box constants render:
Not sure if that helps your testing scenario. |
I was using the box to edit the style to be ASCII using box=box.ASCII but even I updated box Table style didn't change.
As you can see the table didn't change.
The text was updated successfully, but these errors were encountered: