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 178337 Details for
Bug 324669
[dstore] IBM-eucJP to UTF-8 char conversion appends nulls to end of file during text-mode download
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 write byte array up to the limit rather than the entire array
patch.txt (text/plain), 2.13 KB, created by
David McKnight
on 2010-09-07 12:04:25 EDT
(
hide
)
Description:
patch to write byte array up to the limit rather than the entire array
Filename:
MIME Type:
Creator:
David McKnight
Created:
2010-09-07 12:04:25 EDT
Size:
2.13 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.services >Index: src/org/eclipse/rse/services/files/DefaultFileServiceCodePageConverter.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/DefaultFileServiceCodePageConverter.java,v >retrieving revision 1.7 >diff -u -r1.7 DefaultFileServiceCodePageConverter.java >--- src/org/eclipse/rse/services/files/DefaultFileServiceCodePageConverter.java 10 Jun 2009 23:45:36 -0000 1.7 >+++ src/org/eclipse/rse/services/files/DefaultFileServiceCodePageConverter.java 7 Sep 2010 16:03:21 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************** >- * Copyright (c) 2007, 2009 IBM Corporation. All rights reserved. >+ * Copyright (c) 2007, 2010 IBM Corporation. All rights reserved. > * This program and the accompanying materials are made available under the terms > * of the Eclipse Public License v1.0 which accompanies this distribution, and is > * available at http://www.eclipse.org/legal/epl-v10.html >@@ -13,6 +13,7 @@ > * David McKnight (IBM) -[220379] [api] Provide a means for contributing custom BIDI encodings > * David McKnight (IBM) -[246857] Rename problem when a file is opened in the editor > * David McKnight (IBM) -[279014] [dstore][encoding] text file corruption can occur when downloading from UTF8 to cp1252 >+ * David McKnight (IBM) -[324669] [dstore] IBM-eucJP to UTF-8 char conversion appends nulls to end of file during text-mode download > ********************************************************************************/ > package org.eclipse.rse.services.files; > >@@ -76,7 +77,9 @@ > ByteBuffer lclBuf = encoder.encode(decodedBuf); > localBuffer = lclBuf.array(); > outStream = new FileOutputStream(file); >- outStream.write(localBuffer, 0, localBuffer.length); >+ >+ // use the limit rather than the array length to avoid unwanted nulls >+ outStream.write(localBuffer, 0, lclBuf.limit()); > } > } catch (Exception e) { > // outstream could not be written properly: report
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 324669
: 178337