Bug 267247 - [dstore][api] Wrong encoding
Summary: [dstore][api] Wrong encoding
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.0.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks: 268218
  Show dependency tree
 
Reported: 2009-03-05 13:28 EST by Samuel Wu CLA
Modified: 2009-03-19 17:52 EDT (History)
1 user (show)

See Also:


Attachments
patch to use workspace encoding rather than hardcoded UTF-8 as src encoding (14.21 KB, patch)
2009-03-05 15:30 EST, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Wu CLA 2009-03-05 13:28:41 EST
In the method SystemEditableRemoteFile.upload() UTF-8 is used as workstation encoding. It should use the encoding of the workspace.
Comment 1 Samuel Wu CLA 2009-03-05 13:33:34 EST
Please review the references to SystemEncodingUtil.ENCODING_UTF_8.
Comment 2 David McKnight CLA 2009-03-05 15:30:18 EST
Created attachment 127707 [details]
patch to use workspace encoding rather than hardcoded UTF-8 as src encoding

I added a static method to RemoteFileUtility to get the source encoding from an IFile (i.e. does the extra work of falling back to the default workbench encoding).
I've replaced UTF-8 with this src encoding for most upload and download calls.  There are a few that I didn't change due to what appears to be dead code and for archive-handling cases.
Comment 3 Samuel Wu CLA 2009-03-11 09:57:25 EDT
Hi Dave,
Can this fix be ported back to 3.0.x? Thanks.
Comment 4 David McKnight CLA 2009-03-11 10:23:41 EDT
(In reply to comment #3)
> Hi Dave,
> Can this fix be ported back to 3.0.x? Thanks.
> 

Hi Samuel,

We don't have a planned 3.0.4 release.  If this is something your team needs this then we'll have to discuss this.
Comment 5 David McKnight CLA 2009-03-11 16:16:34 EDT
I've committed the change for 3.1.
Comment 6 David McKnight CLA 2009-03-11 16:34:39 EDT
Bug 268218 is created for the backport.
Comment 7 Martin Oberhuber CLA 2009-03-19 17:52:03 EDT
This fix added new API in

org.eclipse.rse.subsystems.files.core.model
  RemoteFileUtility#getSourceEncoding(IFile)