summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/utils.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-12-13 09:00:44 +0000
committerRobert Pösel <robyer@seznam.cz>2012-12-13 09:00:44 +0000
commita6203909a9b4bfbae252ab5b7c616309119d84b3 (patch)
treeb19afdb59ac4afd10dba681ef7c47e16b375d37d /protocols/FacebookRM/src/utils.cpp
parente23f51997817bdaa549fbed05c9eabb83824c8ed (diff)
FacebookRM: Experimental and buggy support for custom smileys
git-svn-id: http://svn.miranda-ng.org/main/trunk@2734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/utils.cpp')
-rw-r--r--protocols/FacebookRM/src/utils.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/protocols/FacebookRM/src/utils.cpp b/protocols/FacebookRM/src/utils.cpp
index 999cb69c56..c3948f67b2 100644
--- a/protocols/FacebookRM/src/utils.cpp
+++ b/protocols/FacebookRM/src/utils.cpp
@@ -134,7 +134,7 @@ unsigned int utils::text::count_all(std::string* data, std::string term)
return count;
}
-void utils::text::append_ordinal(unsigned int value, std::string* data)
+void utils::text::append_ordinal(unsigned long value, std::string* data)
{
if (value >= 128 && value <= 2047)
{ // U+0080 .. U+07FF
@@ -198,6 +198,24 @@ std::string utils::text::special_expressions_decode(std::string data)
continue;
}
+ if (data.at(i) == -19 && (i+2) < data.length()) {
+ std::string chs = data.substr(i, i+2).c_str();
+ unsigned char a[4] = {0};
+ memcpy(&a[1], chs.c_str(), 3);
+
+ new_string += "\\u";
+ utils::text::append_ordinal((unsigned long)a, &new_string);
+
+ /*u = reinterpret_cast<unsigned char&>(data.at(i+1));
+ utils::text::append_ordinal(u, &new_string);
+
+ u = reinterpret_cast<unsigned char&>(data.at(i+2));
+ utils::text::append_ordinal(u, &new_string);*/
+
+ i += 2;
+ continue;
+ }
+
new_string += data.at(i);
}