summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-15 20:53:27 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-18 19:11:44 (GMT)
commit8e1bdd6727a2e0d4e5b0894a83905c275348b037 (patch)
treefc943fabc48f3bb780f82c096eecdefd39fd69b4 /SwifTools
parenta4e59529239902ac352e791767db63a31e2e0634 (diff)
downloadswift-contrib-8e1bdd6727a2e0d4e5b0894a83905c275348b037.zip
swift-contrib-8e1bdd6727a2e0d4e5b0894a83905c275348b037.tar.bz2
JID escaping algorithm refactoring.
Made algorithm more efficient. Fixed some incorrect escaping. Added more tests from the XEP.
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/URIHandler/XMPPURI.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/SwifTools/URIHandler/XMPPURI.cpp b/SwifTools/URIHandler/XMPPURI.cpp
index 496871c..de83ac2 100644
--- a/SwifTools/URIHandler/XMPPURI.cpp
+++ b/SwifTools/URIHandler/XMPPURI.cpp
@@ -48,7 +48,8 @@ struct PercentUnencodeFormatter {
if (s.fail() || s.bad()) {
throw std::runtime_error("Invalid escape character");
}
- return std::string(reinterpret_cast<const char*>(&value), 1);
+ unsigned char charValue = static_cast<unsigned char>(value);
+ return std::string(reinterpret_cast<const char*>(&charValue), 1);
}
};