Bug 182787 - [dstore] dstore server should report its file.encoding property to the client
Summary: [dstore] dstore server should report its file.encoding property to the client
Status: RESOLVED WORKSFORME
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 179937
  Show dependency tree
 
Reported: 2007-04-17 13:02 EDT by Martin Oberhuber CLA
Modified: 2008-08-13 13:18 EDT (History)
6 users (show)

See Also:


Attachments
image of bidi file name for dstore and ssh (32.91 KB, image/jpeg)
2007-05-07 12:10 EDT, David McKnight CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-04-17 13:02:06 EDT
+++ This bug was initially created as a clone of Bug #179937 +++

The dstore server should report the System.getProperty("file.encoding") that it uses to the client.

This System property is used for translating remote system file and path names into Unicode, which is then shipped over the wire. If this setting is incorrect for any reason (e.g. because multiple different encodings are used in different branches of the file system -- see bug 179937), the client needs to decode the Unicode into the original byte stream before it can re-code properly.

Knowing the original encoding is vital for this to work.
Therefore, the dstore server has to report its file.encoding property to the client. Ideally, this should work without any incompatible API or protocol changes.
BIDI3.3:HCG_  UTF-8 not supported for path and file names

Scenario to recreate:

1. Connect to Linux machine using terminal emulator working in UTF-8 encoding.
    (You can use PUTTY with translation set to UTF-8.  Optionally, run shell application (gnome-terminal or konsole) in UTF-8 locale.)
2. Create file with Hebrew characters in its name
3. Create RSE connection to the Linux machine using either SSH or DStore
4. Look at the file name into Remote Systems view of RSE.

Result:  Hebrew characters look like wrong symbols.

Please notice, file names created with Hebrew ASCII encoding look fine.
The problem appears with both UTF-8 or ASCII Hebrew encoding of a container (Eclipse).  There is no option to customize encoding for connection.
Comment 1 Martin Oberhuber CLA 2007-04-17 13:02:33 EDT
Dave - you are expert on dstore, can you do this quickly?
Comment 2 David McKnight CLA 2007-05-07 12:06:16 EDT
I'm not sure I understand this one.   Dstore does call System.getProperty("file.encoding") on the host in response to the C_SYSTEM_ENCODING query.  On the client this query is done via the DStoreFileService.getEncoding(IProgressMonitor) call.

I followed the steps to recreate this (I used Arabic characters in my case - although I would think it should reproduce the same thing as Hebrew characters).  I got different results in the Remote Systems view depending on whether I used SSH or DStore.  For DStore, the name appears correctly, while for SSH it doesn't.  I'll attach what I see for each next.

   
Comment 3 David McKnight CLA 2007-05-07 12:10:41 EDT
Created attachment 66135 [details]
image of bidi file name for dstore and ssh

under the zzz filter, is a bidi filename.  For dstore this displays fine, while I don't see it correctly for SSH.
Comment 4 Martin Oberhuber CLA 2007-05-07 17:44:51 EDT
(In reply to comment #2)
> Dstore does call System.getProperty("file.encoding") on the host in response
> to the C_SYSTEM_ENCODING query.

That's all I wanted -- be able to query the remote what encoding it uses.
If this is possible already now, feel free to close as WORKSFORME.

It's true that SSH doesn't support this (yet) and most proably won't give full encoding support for 2.0.
Comment 5 David McKnight CLA 2007-05-11 09:57:31 EDT
This is already there.
Comment 6 Martin Oberhuber CLA 2008-08-13 13:18:44 EDT
[target cleanup] 2.0 M7 was the original target milestone for this bug