Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348046

Summary: MAC Copy DBCS using HTMLTransfer will be shown as messy code.
Product: [Eclipse Project] Platform Reporter: Zhong Sen Qin <zsqin>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: RESOLVED FIXED QA Contact: Silenio Quarti <Silenio_Quarti>
Severity: normal    
Priority: P3 CC: kleind, lshanmug, mukund, pwebster, Silenio_Quarti
Version: 3.6.1Flags: Silenio_Quarti: review+
Target Milestone: 3.7.1   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
source codes show the defect.
none
result on mac
none
tested with 3.6.2 and 3.7RC3, still has this issue.
none
patch against 3.7 HEAD, same applies to R3_6_maintenance branch none

Description Zhong Sen Qin CLA 2011-06-02 02:13:39 EDT
Build Identifier: 3.6.1

In Mac, when we copy DBCS data into Clipboard using HTMLTransfer will be shown as messy code. But TextTransfer works fine.


Reproducible: Always

Steps to Reproduce:
please see the attached files.
Comment 1 Zhong Sen Qin CLA 2011-06-02 02:16:09 EDT
Created attachment 197217 [details]
source codes show the defect.
Comment 2 Zhong Sen Qin CLA 2011-06-02 02:17:07 EDT
Created attachment 197218 [details]
result on mac
Comment 3 Lakshmi P Shanmugam CLA 2011-06-02 12:37:42 EDT
Looks like Bug 330122. Its fixed in 3.6.2 and 3.7. Please try with 3.6.2 build.

*** This bug has been marked as a duplicate of bug 330122 ***
Comment 4 Zhong Sen Qin CLA 2011-06-08 02:41:35 EDT
Created attachment 197558 [details]
tested with 3.6.2 and 3.7RC3, still has this issue.
Comment 5 Zhong Sen Qin CLA 2011-06-08 02:43:51 EDT
Tested with 3.6.2 and 3.7RC3, still has this issue. So reopen it. Thanks.
Comment 6 mukundan desikan CLA 2011-06-13 14:36:16 EDT
Can this be fixed in 3.7.1?
Comment 7 Silenio Quarti CLA 2011-06-20 10:07:33 EDT
Lakshmi, please investigate. I had a quick look in HTMLTransfer is using system encoding which is probably MacRomman. We need to see if kCFStringEncodingUnicode or kCFStringEncodingUTF8 would work.
Comment 8 Lakshmi P Shanmugam CLA 2011-06-22 06:12:28 EDT
Created attachment 198382 [details]
patch against 3.7 HEAD, same applies to R3_6_maintenance branch

Modified the encoding to OS.kCFStringEncodingUTF8 to fix the problem. I'm unable to test it correctly by pasting in TextEdit. But, I have tested the fix with the SWT ClipboardExample and Mail app and it works fine.
Comment 9 mukundan desikan CLA 2011-06-22 10:54:27 EDT
Thx for the patch.  will let u know the results once we complete testing.
Comment 10 mukundan desikan CLA 2011-07-27 11:48:47 EDT
the patch here works well against our 362 SWT .Tested and verified.
Comment 11 Lakshmi P Shanmugam CLA 2011-07-28 07:38:25 EDT
Hi Silenio, should I commit this fix for 3.7.1 in CVS or git?
Comment 12 Silenio Quarti CLA 2011-07-28 09:45:34 EDT
3.7.x and 3.8 development is done on GIT.
Comment 13 Lakshmi P Shanmugam CLA 2011-08-01 07:48:07 EDT
Thanks Silenio!
Fixed in R3_7_maintenance branch.
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_7_maintenance&id=8f3cbbc468224fdac27e164d00bbec0c8a65bfcc
Comment 14 Silenio Quarti CLA 2011-08-03 10:21:08 EDT
Lakshmi, have you released the patch to master (3.8 branch)? I do not see it there.
Comment 15 Lakshmi P Shanmugam CLA 2011-08-03 10:34:06 EDT
(In reply to comment #14)
> Lakshmi, have you released the patch to master (3.8 branch)? I do not see it
> there.
No, I have released the patch only to 3.7 branch because we are not building Carbon in 3.8. Please let me know if I have to release it to 3.8 branch too.