You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I needed to print a JSON file which had many non-ascii symbols.
I noticed that rich added an utility function and a CLI tool to print JSON beautifully with colors, but turns out the default json.dump settings make this file
Notice that characters like ü and emojis were escaped, which does not look good. ;)
While it is a safe default, I would love to have an option to change this behavior.
It should be as easy as allowing to set the ensure_ascii parameter.
Would you consider merging a PR that adds this functionality?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
Recently I needed to print a JSON file which had many non-ascii symbols.
I noticed that
rich
added an utility function and a CLI tool to print JSON beautifully with colors, but turns out the defaultjson.dump
settings make this fileto look like this:
Notice that characters like
ü
and emojis were escaped, which does not look good. ;)While it is a safe default, I would love to have an option to change this behavior.
It should be as easy as allowing to set the
ensure_ascii
parameter.Would you consider merging a PR that adds this functionality?
Beta Was this translation helpful? Give feedback.
All reactions