Yahoo use utf-8 when manipulate message bytes.

cusax-fix
Damian Minkov 16 years ago
parent 6cbb790186
commit f5b07c310b

@ -162,7 +162,7 @@ public void removeParticipantPresenceListener(
public Message createMessage(byte[] content, String contentType,
String contentEncoding, String subject)
{
return new MessageYahooImpl(new String(content), contentType,
return new MessageYahooImpl(new String(content, "UTF-8"), contentType,
contentEncoding, subject);
}

@ -482,7 +482,7 @@ public void fireLocalUserPresenceEvent(AdHocChatRoom chatRoom,
public Message createMessage(byte[] content, String contentType,
String contentEncoding, String subject)
{
return new MessageYahooImpl(new String(content), contentType,
return new MessageYahooImpl(new String(content, "UTF-8"), contentType,
contentEncoding, subject);
}
@ -661,7 +661,7 @@ public void conferenceMessageReceived(SessionConferenceEvent ev)
Message newMessage =
createMessage(
formattedMessage.getBytes(),
formattedMessage.getBytes("UTF-8"),
OperationSetBasicInstantMessaging.HTML_MIME_TYPE,
OperationSetBasicInstantMessaging.DEFAULT_MIME_ENCODING,
null);

@ -152,7 +152,7 @@ public void sendInstantMessage(Contact to, Message message)
return;
byte[] msgBytesToBeSent = msgDeliveryPendingEvt.getSourceMessage().
getContent().trim().getBytes();
getContent().trim().getBytes("UTF-8");
// split the message in parts with max allowed length
// and send them all
@ -173,13 +173,13 @@ public void sendInstantMessage(Contact to, Message message)
yahooProvider.getYahooSession().sendMessage(
toUserID,
new String(tmp1));
new String(tmp1, "UTF-8"));
}
else
{
yahooProvider.getYahooSession().sendMessage(
toUserID,
new String(msgBytesToBeSent));
new String(msgBytesToBeSent, "UTF-8"));
}
MessageDeliveredEvent msgDeliveredEvt

Loading…
Cancel
Save