Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8170082

JavaFX clipboard erroneously supposes that text/??? are UTF-8

XMLWordPrintable

    • x86_64
    • linux

      FULL PRODUCT VERSION :
      java version "1.8.0_111"
      Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux wanobi 4.8.0-27-generic #29-Ubuntu SMP Thu Oct 20 21:03:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      When pasting content from Gtk clipboard, the code in the two C++ methods
        - Java_com_sun_glass_ui_gtk_GtkSystemClipboard_popFromSystem
        - get_data_raw(JNIEnv *env, const char* mime, gboolean string_data)
      make the assumption that 'text/???', and specially 'text/html' are UTF-8.

      When Firefox pastes content, it is encoded in UTF-16. This fact can be easily detected with the leading BOM sequence (FE FF).

      A workaround is to use the AWT Toolkit Clipboard manager. It lets the user decide how to decode the clipboard contents.

      This is the probable cause of bug 8133337
       http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8133337

      Sorry, I could not find how to add comment on a bug.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See steps of http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8133337


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      A workaround to this bug is to use the AWT Toolkit Clipboard manager. It lets the user decide how to decode the clipboard contents.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: