X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/9bcc50116ad21379a31ab8d65deb36688f2044b3..25f2c3fa03f0729e4f06fbabbb380f4e2ec25e7d:/stglibs/common.lib/common.cpp?ds=inline

diff --git a/stglibs/common.lib/common.cpp b/stglibs/common.lib/common.cpp
index 5bd66c87..1068cfa1 100644
--- a/stglibs/common.lib/common.cpp
+++ b/stglibs/common.lib/common.cpp
@@ -1047,3 +1047,16 @@ while (done < size)
     }
 return true;
 }
+
+std::string ToPrintable(const std::string & src)
+{
+    std::string dest;
+
+    for (size_t i = 0; i < src.size(); ++i)
+        if (std::isprint(src[i]))
+            dest += src[i];
+        else
+            dest += "\\" + x2str(src[i]);
+
+    return dest;
+}