Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 324669
Collapse All | Expand All

(-)src/org/eclipse/rse/services/files/DefaultFileServiceCodePageConverter.java (-2 / +5 lines)
Lines 1-5 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2007, 2009 IBM Corporation. All rights reserved.
2
 * Copyright (c) 2007, 2010 IBM Corporation. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
5
 * available at http://www.eclipse.org/legal/epl-v10.html
5
 * available at http://www.eclipse.org/legal/epl-v10.html
Lines 13-18 Link Here
13
 * David McKnight    (IBM)  -[220379] [api] Provide a means for contributing custom BIDI encodings
13
 * David McKnight    (IBM)  -[220379] [api] Provide a means for contributing custom BIDI encodings
14
 * David McKnight    (IBM)  -[246857] Rename problem when a file is opened in the editor
14
 * David McKnight    (IBM)  -[246857] Rename problem when a file is opened in the editor
15
 * David McKnight    (IBM)  -[279014] [dstore][encoding] text file corruption can occur when downloading from UTF8 to cp1252
15
 * David McKnight    (IBM)  -[279014] [dstore][encoding] text file corruption can occur when downloading from UTF8 to cp1252
16
 * David McKnight    (IBM)  -[324669] [dstore] IBM-eucJP to UTF-8 char conversion appends nulls to end of file during text-mode download
16
 ********************************************************************************/
17
 ********************************************************************************/
17
package org.eclipse.rse.services.files;
18
package org.eclipse.rse.services.files;
18
19
Lines 76-82 Link Here
76
				ByteBuffer lclBuf = encoder.encode(decodedBuf);
77
				ByteBuffer lclBuf = encoder.encode(decodedBuf);
77
				localBuffer = lclBuf.array();
78
				localBuffer = lclBuf.array();
78
				outStream = new FileOutputStream(file);
79
				outStream = new FileOutputStream(file);
79
				outStream.write(localBuffer, 0, localBuffer.length);
80
				
81
				// use the limit rather than the array length to avoid unwanted nulls
82
				outStream.write(localBuffer, 0, lclBuf.limit());
80
			}
83
			}
81
		} catch (Exception e) {
84
		} catch (Exception e) {
82
			// outstream could not be written properly: report
85
			// outstream could not be written properly: report

Return to bug 324669