I am working on a bug where a CJK character is displayed wrongly. I am testing using a simple programme in Eclipse and while debugging 'Variables' section of debugger displays one CJK character wrongly. See the screenshot below. I just assigned "野家xyz" value to a variable and eclipse debugger is displaying it wrongly. Character '', which is a surrogate pair, is replaced with a square. But when I printed it using sysout, it is displayed correctly. Default charset used is 'UTF-8' as you can see from the first line printed in the console. Can someone help me to understand why eclipse is showing it wrongly ?
Eclipse debugger showing cjk character wrongly - Java
290 Views Asked by Sreejith Veluvil AtThere are 2 best solutions below
Till Brychcy
On
The character "" is what Unicode calls a supplementary character with codepoint U+20BB7 and its UTF-8 encoding is F0 A0 AE B7.
Support for such characters has only been added to Java in Version 1.5 by JSR 204, but the code in Eclipse's jdt.debug that reads Strings in UTF-8 format is older than that.
If you look at the implementation of org.eclipse.jdi.internal.jdwp.JdwpString.read(DataInputStream), you can see that is was never updated to handle supplementary characters (which have four byte sequences starting with 0xF*).
It just checks that the upper nibble of the first byte is >= 14 (0xE), effectively interpreting the character's UTF-8 sequence as E0 A0 AE B7 which corresponds to the sequence U+082E U+00B7. U+082E is not a valid unicode character which is why the rectangle is drawn for it.
If you want to report this issue, the bug tracker for this Eclipse component is here.
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in ECLIPSE
- Set log4j.properties for GWT
- Compound classes stored in an array are not accessible in selenium java
- Eclipse color highlighting broken
- Eclipse Luna with Nodeclipse hangs when navigating a .js file with the Outline view
- Java Heap Space error on Layout xml: GC overhead limit exceeded
- Eclipse, how to find how many attributes defined in a class?
- Eclipse and Windows Headers
- Eclipse find source file from library
- mingw-64 conflicting declarations when cross-compiling
- String.split() not behaving in android
- local variable referenced before assignment in strange condition
- eclipse errors when try to change to master git branch
- Scala Eclipse IDE compiler giving errors until "clean" is run
- Not able to send email in java using SMTP,its blocked by firewall in my office.Is there any other method by which we can send mail?
- Behaviour Difference: Intellij vs Eclipse
Related Questions in UNICODE
- Why is executing Java code in comments with certain Unicode characters allowed?
- LXML to write in unicode?
- erlang os:cmd() command with UTF8 binary
- How to encode bytes as a printable unicode string (like base64 for ascii)
- Unicode error from pip install
- How to express the full range of values of a char in F#?
- Change lowercase and uppercase of characters in java
- Need code for removing all unicode characters in vb6
- Error passing Unicode string through JSONObject
- How to combine Unicode characters
- FreeType2 and OpenGL : Use unicode
- Unicode Japanese prolonged sound mark excluded from Kana script?
- Parsing string containing Unicode character names
- How can I add an icon to select box choices?
- Displaying unicode characters in Python 3
Related Questions in UTF-8
- Site code to enable UTF-8 to EBCDIC encoding
- Wrong output when str_replace with acute ( ´ ) in utf-8 website
- How to encode bytes as a printable unicode string (like base64 for ascii)
- showing umlauts in html with utf8 charset
- Replace special qoutes with normal
- wxWidgets and UTF8 - some characters missing
- Detecting corrupt characters in UTF-8 encoded text file
- Control encoding when parsing SPSS file using package memisc
- Slidify no longer renders accent marks
- javascript treating special characters as utf characters
- Character encoding is missing at a point
- Search special characters with pg_search
- Hot deploying HTML templates generates question marks in the place of chinese characters - only on CentOS
- Reading from property file containing utf 8 character
- Problems with UTF8 text in XE7 ReadLn command
Related Questions in SUPPLEMENTARY
- Java 7, regexes and supplementary unicode characters
- Java reading in character streams with supplementary unicode characters
- How to enter non-BMP unicode (hexadecimal with more than 4 characters) as input to Mathematica
- Update CollectionView supplementaryView header when off screen
- Supplementary character support in Java web application with Mysql
- Header section not displaying in collectionview programmatically
- SQL Query Where Column = '' returning Emoji characters and
- How to replace all non-supplementary chars, but leave all supplementary as is?
- Eclipse debugger showing cjk character wrongly - Java
- how to print a glyph of supplementary characters in java onto my JTextField when i just click the button
- Map supplementary Unicode characters to BMP (if possible)
- UICollectionView Floating Headers on Top and Side
- Are supplementary characters allowed in XML names?
- Animating a UICollectionView supplementary view resize
- Ruby string escape for supplementary plane Unicode characters
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

Looks like this is a bug in Eclipse IDE, Variables window.
I have added a detail formatter to get the unicode entities for the text "野家xyz". Then decoded the returned unicode entities to unicode text using an online tool. Here's the outputs I got.
Detail Formatter Code
Detail Formatter Output
Screenshots
I used this online unicode converter to check the result.
Looks like the data in the variable still corresponds to the correct text, but the IDE can't render it. So I think this should be a bug in Eclipse.