From 2746cc671db5453801b57b7ea1b27ff781e7e87e Mon Sep 17 00:00:00 2001 From: --nn <33792276+nnyte@users.noreply.github.com> Date: Sat, 18 Nov 2017 14:03:44 -0800 Subject: [PATCH] Fix unicode escape sequence formatting --- RenX.ServerList/RenX_ServerList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RenX.ServerList/RenX_ServerList.cpp b/RenX.ServerList/RenX_ServerList.cpp index eda471d..ef4eb95 100644 --- a/RenX.ServerList/RenX_ServerList.cpp +++ b/RenX.ServerList/RenX_ServerList.cpp @@ -52,7 +52,7 @@ Jupiter::String jsonify(const Jupiter::ReadableString &in_str) result += '\"'; } else if (*ptr < 0x20) // control characters - result.aformat("\\u00%x", *ptr); + result.aformat("\\u%04x", *ptr); else if ((*ptr & 0x80) != 0) // UTF-8 sequence; copy to bypass above processing { result += *ptr; @@ -105,7 +105,7 @@ Jupiter::String sanitize_game(const Jupiter::ReadableString &in_str) result += '\"'; } else if (*ptr < 0x20) // control characters - result.aformat("\\u00%x", *ptr); + result.aformat("\\u%04x", *ptr); else if (*ptr == '~') // Game server list control character result += "\\u007E"_jrs; else if (*ptr == ';') // Game server list control character