Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 83137 Details for
Bug 188583
[msn] Msn retrieve Buddy List error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to force the usage of UTF-8 as an encoding.
bug188583-utf-8-patch.txt (text/plain), 5.45 KB, created by
Remy Suen
on 2007-11-16 18:47:37 EST
(
hide
)
Description:
Patch to force the usage of UTF-8 as an encoding.
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2007-11-16 18:47:37 EST
Size:
5.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ecf.protocol.msn >Index: src/org/eclipse/ecf/protocol/msn/NotificationSession.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/providers/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/NotificationSession.java,v >retrieving revision 1.4 >diff -u -r1.4 NotificationSession.java >--- src/org/eclipse/ecf/protocol/msn/NotificationSession.java 27 Oct 2007 16:56:38 -0000 1.4 >+++ src/org/eclipse/ecf/protocol/msn/NotificationSession.java 16 Nov 2007 23:46:39 -0000 >@@ -124,7 +124,7 @@ > private void retrieveBuddyList() throws IOException { > write("SYN", "0 0"); //$NON-NLS-1$ //$NON-NLS-2$ > >- BufferedReader reader = new BufferedReader(new InputStreamReader(getInputStream())); >+ BufferedReader reader = new BufferedReader(new InputStreamReader(getInputStream(), "UTF-8")); //$NON-NLS-1$ > String input = reader.readLine(); > while (input == null || !input.startsWith("SYN")) { //$NON-NLS-1$ > input = reader.readLine(); >Index: src/org/eclipse/ecf/protocol/msn/ChatSession.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/providers/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/ChatSession.java,v >retrieving revision 1.4 >diff -u -r1.4 ChatSession.java >--- src/org/eclipse/ecf/protocol/msn/ChatSession.java 9 Nov 2007 03:14:36 -0000 1.4 >+++ src/org/eclipse/ecf/protocol/msn/ChatSession.java 16 Nov 2007 23:46:39 -0000 >@@ -52,8 +52,6 @@ > > private final String email = client.getUserEmail(); > >- private boolean joined = false; >- > /** > * Create a new ChatSession that connects to the given host. > * >@@ -141,8 +139,6 @@ > } > } > write("CAL", email); //$NON-NLS-1$ >- while (!joined); >- joined = false; > } > > /** >@@ -267,7 +263,6 @@ > contact = new Contact(split[1], split[2]); > } > contacts.add(contact); >- joined = true; > fireContactJoinedEvent(contact); > } else if (lines[i].startsWith("BYE")) { //$NON-NLS-1$ > final String[] split = StringUtils.splitOnSpace(lines[i]); >@@ -296,8 +291,8 @@ > final int count = Integer.parseInt(split[3]); > split = StringUtils.split(contents[index - 1], "\r\n\r\n"); //$NON-NLS-1$ > >- final int text = count - (split[0].length() + 4); >- fireMessageReceivedEvent(contact, split[1].substring(0, text)); >+ final int text = count - (split[0].getBytes("UTF-8").length + 4); //$NON-NLS-1$ >+ fireMessageReceivedEvent(contact, new String(split[1].getBytes("UTF-8"), 0, text, "UTF-8")); //$NON-NLS-1$ //$NON-NLS-2$ > } > } > } >@@ -336,7 +331,7 @@ > + "Content-Type: text/plain; charset=UTF-8\r\n" //$NON-NLS-1$ > + "X-MMS-IM-Format: FN=MS%20Sans%20Serif; EF=; CO=0; PF=0\r\n\r\n" //$NON-NLS-1$ > + message; >- write("MSG", "N " + message.length() + "\r\n" + message, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ write("MSG", "N " + message.getBytes("UTF-8").length + "\r\n" + message, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ > } > > /** >Index: src/org/eclipse/ecf/protocol/msn/Session.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/providers/org.eclipse.ecf.protocol.msn/src/org/eclipse/ecf/protocol/msn/Session.java,v >retrieving revision 1.2 >diff -u -r1.2 Session.java >--- src/org/eclipse/ecf/protocol/msn/Session.java 19 May 2007 21:06:18 -0000 1.2 >+++ src/org/eclipse/ecf/protocol/msn/Session.java 16 Nov 2007 23:46:40 -0000 >@@ -10,9 +10,7 @@ > ******************************************************************************/ > package org.eclipse.ecf.protocol.msn; > >-import java.io.IOException; >-import java.io.InputStream; >-import java.io.OutputStream; >+import java.io.*; > import java.net.Socket; > import java.util.ArrayList; > >@@ -63,7 +61,7 @@ > * A thread used to wait indefinitely for incoming messages from the server. > */ > private IdleThread idleThread; >- >+ > private boolean closed = false; > > Session(MsnClient client) { >@@ -117,8 +115,7 @@ > final void openSocket(String host) throws IOException { > closed = false; > int index = host.indexOf(':'); >- openSocket(host.substring(0, index), Integer.parseInt(host >- .substring(index + 1))); >+ openSocket(host.substring(0, index), Integer.parseInt(host.substring(index + 1))); > } > > final void openSocket(String ip, int port) throws IOException { >@@ -144,9 +141,8 @@ > int read = is.read(buffer); > if (read < 1) { > return null; >- } else { >- return new String(buffer, 0, read).trim(); > } >+ return new String(buffer, 0, read, "UTF-8").trim(); //$NON-NLS-1$ > } > > /** >@@ -164,7 +160,7 @@ > * channel. > */ > private final void write(String input, boolean newline) throws IOException { >- byte[] bytes = newline ? (input + "\r\n").getBytes() : input.getBytes(); //$NON-NLS-1$ >+ byte[] bytes = newline ? (input + "\r\n").getBytes("UTF-8") : input.getBytes("UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > os.write(bytes); > os.flush(); > } >@@ -201,8 +197,7 @@ > * If an I/O error occurs while attempting to write to the > * channel. > */ >- final void write(String command, String parameters, boolean newline) >- throws IOException { >+ final void write(String command, String parameters, boolean newline) throws IOException { > transactionID++; > write(command + ' ' + transactionID + ' ' + parameters, newline); > } >@@ -273,7 +268,7 @@ > idleThread.start(); > } > } >- >+ > final boolean isClosed() { > return closed; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 188583
: 83137