From ad465929229a928d418c68b7786c18f95f170eba Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 21 Feb 2013 00:33:29 +0300 Subject: Fix some incorrect chars in browserbox links. --- src/utils/stringutils.cpp | 10 ++++++++++ src/utils/stringutils.h | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'src/utils') 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 -- cgit v1.2.3-70-g09d2