From fcb441cbd7055a8376d52d244ccf789ee432857e Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 4 Oct 2013 18:49:02 +0000 Subject: [PATCH] fixed utf8/wstring calls git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6799 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/rpc/proto/rpcprotochat.cc | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/retroshare-nogui/src/rpc/proto/rpcprotochat.cc b/retroshare-nogui/src/rpc/proto/rpcprotochat.cc index 1298206e5..388685c5d 100644 --- a/retroshare-nogui/src/rpc/proto/rpcprotochat.cc +++ b/retroshare-nogui/src/rpc/proto/rpcprotochat.cc @@ -1001,8 +1001,7 @@ int RpcProtoChat::processReqSendMessage(uint32_t chan_id, uint32_t /*msg_id*/, u // Send the message. bool priv_or_lobby = true; std::string chat_id; - std::wstring chat_msg; - convertUTF8toWString(req.msg().msg(), chat_msg); + std::string chat_msg = req.msg().msg() ; std::cerr << "Chat Message is: " << req.msg().msg(); std::cerr << std::endl; @@ -1146,9 +1145,7 @@ int RpcProtoChat::locked_checkForEvents(uint32_t event, const std::listpeer_nickname; std::cerr << std::endl; { - std::string msg_utf8; - librs::util::ConvertUtf16ToUtf8(it->msg, msg_utf8); - std::cerr << " Msg: " << msg_utf8; + std::cerr << " Msg: " << it->msg ; std::cerr << std::endl; } @@ -1222,9 +1219,7 @@ int RpcProtoChat::locked_checkForEvents(uint32_t event, const std::listpeer_nickname; std::cerr << std::endl; { - std::string msg_utf8; - librs::util::ConvertUtf16ToUtf8(it->msg, msg_utf8); - std::cerr << " Msg: " << msg_utf8; + std::cerr << " Msg: " << it->msg; std::cerr << std::endl; } /* must send to all registered clients */ @@ -1427,16 +1422,7 @@ bool createQueuedEventSendMsg(const ChatInfo &chatinfo, rsctrl::chat::ChatType c msg->set_chat_flags(chatinfo.chatflags); msg->set_send_time(chatinfo.sendTime); msg->set_recv_time(chatinfo.recvTime); - - std::string msg_utf8; - if (!convertWStringToUTF8(chatinfo.msg, msg_utf8)) - { - std::cerr << "RpcProtoChat::createQueuedEventSendMsg() ERROR Converting Msg"; - std::cerr << std::endl; - return false; - } - - msg->set_msg(msg_utf8); + msg->set_msg(chatinfo.msg); /* DONE - Generate Reply */ std::string outmsg;