This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 379094 - bidi2012 - Error when paste project path with Hebrew to Windows Explorer
Summary: bidi2012 - Error when paste project path with Hebrew to Windows Explorer
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-10 05:50 EDT by Helena Halperin CLA
Modified: 2020-03-04 17:07 EST (History)
4 users (show)

See Also:


Attachments
workspace path (21.71 KB, image/png)
2012-05-10 05:51 EDT, Helena Halperin CLA
no flags Details
project properties (31.08 KB, image/jpeg)
2012-05-10 05:51 EDT, Helena Halperin CLA
no flags Details
explorer error (32.37 KB, image/png)
2012-05-10 05:52 EDT, Helena Halperin CLA
no flags Details
Patch for org.eclipse.ui.ide plugin (4.18 KB, patch)
2012-06-03 03:07 EDT, Ira Fishbein CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helena Halperin CLA 2012-05-10 05:50:08 EDT
Build Identifier: version 3.8 build I20120314-1800

When project path containing Hebrew, copied from Properties view and pasted to Windows explorer, the path can't be found.

Reproducible: Always

Steps to Reproduce:
This is Hebrew specific problem. The machine locale should be set to Hebrew
1. Create a directory and sub-directory with Hebrew names, create directory
"ws3_8" under Hebrew sub-directory.
2. Open eclipse, in "select workspace" dialog, browse to created "ws3_8"
directory.
3. Create a new Java project. Use default location for the project.
4. Open properties view for the created project.
5. Copy the location path and paste the path to Windows explorer. Click on "Go to"

result: error,windows can't find the path
Comment 1 Helena Halperin CLA 2012-05-10 05:51:00 EDT
Created attachment 215381 [details]
workspace path
Comment 2 Helena Halperin CLA 2012-05-10 05:51:38 EDT
Created attachment 215383 [details]
project properties
Comment 3 Helena Halperin CLA 2012-05-10 05:52:06 EDT
Created attachment 215384 [details]
explorer error
Comment 4 Grant Gayed CLA 2012-05-17 11:21:04 EDT
Comparing the screenshots in comment 1 and comment 2, it looks like the two path segments with Hebrew characters are swapped.  Can you confirm that this is the root of the problem?  So the screenshot in comment 3 shows failure because the path that is being pasted into Windows Explorer really does not exist, because its two segments are swapped?
Comment 5 Grant Gayed CLA 2012-05-17 11:36:12 EDT
This may have the same root cause as bug 378813.
Comment 6 Grant Gayed CLA 2012-05-17 14:36:15 EDT
Actually I just tried this scenario and it worked for me.  I'm on Windows 7, using eclipse build I20120515-2200.  It's possible that swt has changed in this area since the build that you tested on.  Can you try this case again with a recent build like http://download.eclipse.org/eclipse/downloads/drops4/I20120516-1900/ ?
Comment 7 Helena Halperin CLA 2012-05-20 04:52:49 EDT
I tried build I20120518-2145, the  bug is here. Please check that  you run eclipse with Hebrew locale. Use -nl iw, or set Formats in "Region and Language" options to Hebrew.
Comment 8 Helena Halperin CLA 2012-05-21 08:01:34 EDT
It is possible, that we get error in explorer, because Unicode control characters are not removed from the path during copy. Unicode control characters are added to the proper display of the path in the Properties view.
Comment 9 Ira Fishbein CLA 2012-06-03 03:07:32 EDT
Created attachment 216728 [details]
Patch for org.eclipse.ui.ide plugin

Please find attached patch with solution for reported problem.
Ira
Comment 10 Tomer Mahlin CLA 2012-06-03 03:54:09 EDT
Hello Grant. Several observations:

1. The location field in Properties dialog (screen snapshot is added in comment #2) is implemented via Text input field object.

2. So far the resolution of structured text problem (file path falls into this category) was handled by org.eclipse.osgi.util.TextProcessor. This method used Unicode Control Characters (Unicode characters without any associated glyphs which makes them invisible) and injected them into string at appropriate places to assure that Unicode Bidi Algorithm preserve relative order of tokens (in case of file path, relative order of folders names) during text reordering and display.

3. The problem with this approach is that UCC even though they are invisible they do change the content of the string. Thus when text including UCC is copied from Text input field (Location field) and paste into Windows Explorer, the path represented by text can't be found. 

4. Much more robust solution for Text input fields in the context of structured text was introduced via bug 230854. The solution proposed below leverages this new approach for handling structured text inside Eclipse. 

We would appreciate very much if you can review the fix.
Many thanks in advance.
Comment 11 Grant Gayed CLA 2012-06-14 16:01:19 EDT
Changes are at the UI level, so moving to UI to review and commit.  The approach is correct in that UI should do the work in the SegmentListener since it knows that the string represents a path (note that we have not reviewed the changes in detail).
Comment 12 Paul Webster CLA 2012-11-06 09:28:56 EST
This is dependent on the work in bug 383185 now, right?

PW
Comment 13 Tomer Mahlin CLA 2012-11-06 09:44:04 EST
Correct. Once the work for bug 38185 is complete an updated patch will be provided here.
Comment 14 Tomer Mahlin CLA 2012-11-06 09:44:51 EST
Sorry, I meant bug 383185 of course.
Comment 15 Eclipse Genie CLA 2020-03-04 17:07:33 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.