summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.cpp10
-rw-r--r--src/utils/stringutils.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 74e5d9f58..d4585a26d 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -668,3 +668,13 @@ signed char parseBoolean(const std::string &value)
else
return -1;
}
+
+std::string encodeLinkText(std::string data)
+{
+ return replaceAll(data, "|", "\342\235\230");
+}
+
+std::string decodeLinkText(std::string data)
+{
+ return replaceAll(data, "\342\235\230", "|");
+}
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index 612486cb2..8b3ae0563 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -223,4 +223,8 @@ std::string getDateString() A_WARN_UNUSED;
signed char parseBoolean(const std::string &value);
+std::string encodeLinkText(std::string data);
+
+std::string decodeLinkText(std::string data);
+
#endif // UTILS_STRINGUTILS_H