JDK-8165680 : [macosx] Enhance handling of UTF-8 characters in CDataTransfer.java
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2016-09-08
  • Updated: 2016-12-01
  • Resolved: 2016-11-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b147Fixed
Related Reports
Relates :  
Description
Suggestion to change the handling of UTF-8 characters in CDataTransfer.java

charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), "UTF-8���);

should probably be changed to 

   import java.nio.charset.StandardCharsets;
   [...]
   charset = new String((byte[]) transferable.getTransferData(javaTextEncodingFlavor), StandardCharsets.UTF_8);

to avoid the unnecessary charset lookup. Suggestion is made just to improve the codebase.