Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse does not display Chinese characters
Eclipse does not display Chinese characters [message #1793802] Thu, 16 August 2018 05:49 Go to next message
Arthur Chan is currently offline Arthur ChanFriend
Messages: 4
Registered: April 2018
Junior Member
From eclipse, I am running a PHP script which has an embedded call to a cloud mySQL stored procedure.

Eclipse returns the dataset correctly in English, but Chinese characters cannot be displayed properly. mySQL Workbench can store and display Chinese characters correctly.

This is what I 've tried so far:

(1) In mySQL, I created the table wikth this specification:
ENGINE=INNODB AUTO_INCREMENT= 2468 CHARACTER SET utf8 COLLATE utf8_general_ci;

(2) In the PHP script, I specified the header like this:
header("Content-type:application/json; charset=utf-8");
(3) The response is json_encoded, like this:
echo json_encode(array("db_response"=>$response));

(4) And in eclipse, I've set thre preference to utf-8, like this:
Window -> Preferences -> General -> Workspace -> title file encoding Other UTF-8

Chinese characters are displayed like this:
??????(??)????

Can anyone point me in the right direction please?

Is there some other fonts I need to download and install in eclipse? If so, which one?
Re: Eclipse does not display Chinese characters [message #1793811 is a reply to message #1793802] Thu, 16 August 2018 08:59 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6113
Registered: July 2009
Senior Member
Hi

I'm far from expert on Chinese characters, but I have on one occasion seen Chinese characters in comments in IIRC a QVTo transformation, so I think that at least some Chinese characters work.

I recommend experimenting with cut and paste between simple editors such as the Text Editor, Java Editor, Geneic Text Editor within Eclipse and generic OS editors, perhaps Notepad/Notepad2/Notepad2++ on Windows to see what works, Then investigate specific SQL/PHP tools which may have encoding/rendering bugs.

I do not recommend setting the Workspace preference since that is not shared by any colleagues with whom you communicate via a CM such as GIT. Better to set the project preference.

Regards

Ed Willink
Re: Eclipse does not display Chinese characters [message #1793841 is a reply to message #1793811] Fri, 17 August 2018 01:41 Go to previous messageGo to next message
Arthur Chan is currently offline Arthur ChanFriend
Messages: 4
Registered: April 2018
Junior Member
Thx, I am still trying to get Java to display Chinese (plus another language) in eclipse.
I am using Widnows 10, but that doesn't seem to be the problem... far as I can tell for now...
No problem with data in English, so it has to be some char-set or settings that I am missing...

[Updated on: Fri, 17 August 2018 01:42]

Report message to a moderator

Re: Eclipse does not display Chinese characters [message #1793848 is a reply to message #1793841] Fri, 17 August 2018 07:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6113
Registered: July 2009
Senior Member
Hi

The second attachment to https://www.eclipse.org/forums/index.php/mv/msg/1092554/1784609/#msg_1784609 shows some possibly Chinese characters in the comments. However it appears that I failed to display them consistently in my Eclipse; only by using UTF-16 did Chinese characters appear, but for everything. The issue of Chinese characters was a major red herring in that thread, and it seems that I did not resolve the rendering. Using UTF8, the rendering is plausible but with diamonds for the Chinese characters suggesting it might indeed be an installed font problem, but I am not aware how to install fonts into Eclipse; I think Eclipse just uses the numerous fonts that accompany the JVM/OS. Perhaps you need to install extra fonts into your OS; e.g. https://blogs.msdn.microsoft.com/nav/2017/09/14/windows-10-and-chinese-supplemental-fonts-with-microsoft-dynamics-nav-reports/

Regards

Ed Willink
Re: Eclipse does not display Chinese characters [message #1794208 is a reply to message #1793802] Mon, 27 August 2018 14:15 Go to previous message
jack zar is currently offline jack zarFriend
Messages: 1
Registered: August 2018
Junior Member
Thanks, I am still trying to get Java to display Chinese (plus another language) in eclipse.
Previous Topic:Missing artifact sun.jdk:tools:jar:LATEST
Next Topic:Eclipse wont open
Goto Forum:
  


Current Time: Mon Nov 19 15:53:48 GMT 2018

Powered by FUDForum. Page generated in 0.02553 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top