From 3afbc191a31c284160e0083f1b48cd874da606b5 Mon Sep 17 00:00:00 2001 From: Goxiaoy Date: Wed, 18 Aug 2021 14:06:07 +0800 Subject: [PATCH 1/6] dump strings in rasa shell with ensure_ascii=false --- rasa/core/channels/console.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rasa/core/channels/console.py b/rasa/core/channels/console.py index f1f00576b2e2..acad38ad9a9a 100644 --- a/rasa/core/channels/console.py +++ b/rasa/core/channels/console.py @@ -19,6 +19,7 @@ from rasa.core.constants import DEFAULT_SERVER_URL from rasa.shared.constants import INTENT_MESSAGE_PREFIX from rasa.shared.utils.io import DEFAULT_ENCODING +from rasa.shared.utils.io import json_to_string logger = logging.getLogger(__name__) @@ -88,7 +89,7 @@ def _print_bot_output( if "custom" in message: rasa.shared.utils.cli.print_color("Custom json:", color=color) rasa.shared.utils.cli.print_color( - json.dumps(message["custom"], indent=2), color=color + json_to_string(message["custom"]), color=color ) return None From 83b105cf14976d5e014875160410ccf4113e08d4 Mon Sep 17 00:00:00 2001 From: Goxiaoy Date: Wed, 18 Aug 2021 14:16:43 +0800 Subject: [PATCH 2/6] add changelog --- changelog/9386.bugfix.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9386.bugfix.md diff --git a/changelog/9386.bugfix.md b/changelog/9386.bugfix.md new file mode 100644 index 000000000000..34609a20e290 --- /dev/null +++ b/changelog/9386.bugfix.md @@ -0,0 +1 @@ +``rasa shell`` now outputs custom json unicode characters instead of ``\uxxxx`` codes \ No newline at end of file From 5d27833eab6f44b2cab0b55a9fbf1d32c84a6307 Mon Sep 17 00:00:00 2001 From: Goxiaoy Date: Fri, 20 Aug 2021 00:49:46 +0800 Subject: [PATCH 3/6] Update changelog/9386.bugfix.md Co-authored-by: Tobias Wochinger --- changelog/9386.bugfix.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/9386.bugfix.md b/changelog/9386.bugfix.md index 34609a20e290..8879c14ee409 100644 --- a/changelog/9386.bugfix.md +++ b/changelog/9386.bugfix.md @@ -1 +1 @@ -``rasa shell`` now outputs custom json unicode characters instead of ``\uxxxx`` codes \ No newline at end of file +`rasa shell` now outputs custom json unicode characters instead of `\uxxxx` codes \ No newline at end of file From 3dbb288d93a22f3cd4bcae5903a3a0596877db69 Mon Sep 17 00:00:00 2001 From: Goxiaoy Date: Fri, 20 Aug 2021 00:49:53 +0800 Subject: [PATCH 4/6] Update rasa/core/channels/console.py Co-authored-by: Tobias Wochinger --- rasa/core/channels/console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rasa/core/channels/console.py b/rasa/core/channels/console.py index acad38ad9a9a..4b5e1d00ecef 100644 --- a/rasa/core/channels/console.py +++ b/rasa/core/channels/console.py @@ -19,7 +19,7 @@ from rasa.core.constants import DEFAULT_SERVER_URL from rasa.shared.constants import INTENT_MESSAGE_PREFIX from rasa.shared.utils.io import DEFAULT_ENCODING -from rasa.shared.utils.io import json_to_string +import rasa.shared.utils.io logger = logging.getLogger(__name__) From 18c888c43a72f8e2ea7e6ed7292f44c480c6f7e9 Mon Sep 17 00:00:00 2001 From: Goxiaoy Date: Fri, 20 Aug 2021 00:50:01 +0800 Subject: [PATCH 5/6] Update rasa/core/channels/console.py Co-authored-by: Tobias Wochinger --- rasa/core/channels/console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rasa/core/channels/console.py b/rasa/core/channels/console.py index 4b5e1d00ecef..8b4f01ce25f1 100644 --- a/rasa/core/channels/console.py +++ b/rasa/core/channels/console.py @@ -89,7 +89,7 @@ def _print_bot_output( if "custom" in message: rasa.shared.utils.cli.print_color("Custom json:", color=color) rasa.shared.utils.cli.print_color( - json_to_string(message["custom"]), color=color + rasa.shared.utils.io.json_to_string(message["custom"]), color=color ) return None From 4cbfaa312bf6506cb4c403ade57a18c3bf393d61 Mon Sep 17 00:00:00 2001 From: Goxiaoy Date: Tue, 19 Apr 2022 18:39:59 +0800 Subject: [PATCH 6/6] rm duplicate import --- rasa/core/channels/console.py | 1 - 1 file changed, 1 deletion(-) diff --git a/rasa/core/channels/console.py b/rasa/core/channels/console.py index 162ea79417e6..1f7b59b6e7b6 100644 --- a/rasa/core/channels/console.py +++ b/rasa/core/channels/console.py @@ -18,7 +18,6 @@ from rasa.core.constants import DEFAULT_SERVER_URL, DEFAULT_STREAM_READING_TIMEOUT from rasa.shared.constants import INTENT_MESSAGE_PREFIX from rasa.shared.utils.io import DEFAULT_ENCODING -import rasa.shared.utils.io logger = logging.getLogger(__name__)