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
The behaviour of CSafeDumper differs from SafeDumper with respect to the allow_unicode parameter. SafeDumper will emit the unicode unescaped whereas CSafeDumper appears to ignore the parameter and emits the \U.... escaped version of the unicode character.
Is this expected?
Example:
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
PyYAML 6.0.1
>>>importyaml>>>text="😸 is not escaped">>>print(yaml.dump_all([text], encoding="utf-8", allow_unicode=True, Dumper=yaml.SafeDumper).decode("utf-8"))
😸 isnotescaped>>>print(yaml.dump_all([text], encoding="utf-8", allow_unicode=True, Dumper=yaml.CSafeDumper).decode("utf-8"))
"\U0001F638 is not escaped"
The text was updated successfully, but these errors were encountered:
The behaviour of
CSafeDumper
differs fromSafeDumper
with respect to theallow_unicode
parameter.SafeDumper
will emit the unicode unescaped whereasCSafeDumper
appears to ignore the parameter and emits the\U....
escaped version of the unicode character.Is this expected?
Example:
The text was updated successfully, but these errors were encountered: