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
Hi,
indeed, for some reason we are getting Utf-16 instead of Utf-8 encoded data from json.dumps.
Like this German umlaut: json.dumps({"test":"über"}) results in '{"test": "\\u00fcber"}'.
Here is a test for this issue:
*** Settings ***
Library JSONLibrary
*** Test Cases ***
Test_Conversion short
${data} = Set Variable "{'test':'über'}"
${json} = Convert String To Json ${data}
${string} = Convert Json To String ${json}
# Issue: "{'test':'\u00fcber'}" != "{'test':'über'}"
Should Be Equal ${string} ${data}
I created a PR here as a workaround to forward the ensure_ascii parameter to json.dumps: #60
Function convert_json_to_string returns wrong encoding if you use UTF-8. I have workaround:
` @staticmethod
def convert_json_to_string(json_object):
"""Convert JSON object to string
The text was updated successfully, but these errors were encountered: