Community
Participate
Working Groups
I have problem to diplay one letter in arabic all 25 alphabetic are displayes correctly but the letter "fa" is displayes as question mark. how to fix this in Eclipse. thanks
Is this when typing into the editor or when opening a file? Make sure to use a font that contains those characters and that the encoding is correct.
(In reply to comment #1) > Is this when typing into the editor or when opening a file? > Make sure to use a font that contains those characters and that the encoding is > correct. it is the same when i read from file or use the editor. i have just problem with one letter which is "fa" the other 27 letters displaying correctly, for encoding i use the right one for arabic which is utf8. any help
Then I suppose this character isn't in your font. Check the font with a tool.
(In reply to comment #3) > Then I suppose this character isn't in your font. Check the font with a tool. (In reply to comment #3) > Then I suppose this character isn't in your font. Check the font with a tool. thnaks for your answer, could you tell me please how to change the font in Eclipse? thnaks in advance
Window > Preference > Colors and Fonts
i still have problem, how you close before solving this problem, i tryed all arabic fonts with out any success, as arabic useres we have this problems in Eclipse, i think there is bug with the letter "Fa". any help ?
Do those fonts work in other editors? What VM and encoding are you using? Does it also not work in the standard Eclipse Text editor?
(In reply to comment #7) > Do those fonts work in other editors? What VM and encoding are you using? Does > it also not work in the standard Eclipse Text editor? hi thanks for your answer, i am using utf8 encoding, i have no problem at all to display any Arabic alphabetic except the letter "fa" instead of "fa" i get "?" , i am using just Eclipse and to use standard editor i need then to display the result on the dos screen which i will get just "???". the strange thing that i have problem just with one letter. i did download Eclipse standard editor and unzip it inside the eclipse folder and add it also as a library but i couldn't see any different. any help
.
Moving to SWT for comments.
Does the letter 'fa' work in Wordpad.exe? Can you set the same font in Wordpad that you are using in Eclipse?
(In reply to comment #11) > Does the letter 'fa' work in Wordpad.exe? Can you set the same font in > Wordpad that you are using in Eclipse? Yes it is work every where in WordPad or notepad or WinWord, it is also work inside the Eclipse editor the problem just when i am displaying it after i run the program i got ? instead of "fa" this is also problem when i use this letter for furture operations , for the font i did use all Arabic fonts in Eclipse but the same problem .this is some simple code which printing some word in Arabic : import java.io.IOException; import java.io.UnsupportedEncodingException; import java.sql.SQLException; public class font { public static void main(String[] args) { String word_temp="ÇáÝÑÓÇä"; try { word_temp = new String(word_temp.getBytes("utf8" )); } catch (UnsupportedEncodingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } System.out.println(word_temp); } } the reuslt: Çá?ÑÓÇä ----- i hope you can see the arabic letter in your PC, if not please change to arabic windows encoding from your browser.
OK, so you are running a program and are not seeing the output correctly in the Console view?
(In reply to comment #13) > OK, so you are running a program and are not seeing the output correctly in the > Console view? Yes this is right, and this is mean also that i can't use the letter "fa" for any comparision.
It would have helped if you mentioned the Console in the first comment. Anyway, are you sure that you've set the CONSOLE font and not some other font? Also, do you have the right encoding when launching?
Well the console is not the unique problem as i can't make any comparion regarding to this problem, i set the right encoding when launching otherwise i wont have the other letters in the right format , also i tryed all Arabic fonts for CONSOLE with no success. I repeat the problem is strange and clear Eclipse has a problem with the letter "fa" only .With other Arabic letter no problem at all, I don't know for other Editor if the problem the same or not but i don't like to change Eclipse in this moment. Any help?
This doesn't work: String word_temp="ÇáÝÑÓÇä"; The right form is: String word_temp="\u0627\u0644\u0641\u0631\u0633\u0627\u0646"; And why do you need: word_temp = new String(word_temp.getBytes("utf8" )); This doesn't look right. Use the string I gave you above and System.out.println(string); will work (of course, the console font has to support Arabic). Pls, reopen this problem report if you need (provide a better testcase if do that).
wontfix
hi, it is the same problem , // And why do you need: word_temp = new String(word_temp.getBytes("utf8" )); I need taht otherwise i won't be able to display any arabic letter correctly!! // String word_temp="\u0627\u0644\u0641\u0631\u0633\u0627\u0646"; this is not working and even this is working it is not good solution , imagine if i have thousands strings, i don't think i need to convert them all. I think understanding my problem is 80 % from the solution, we have to understand it is not font problem then why the font work for 27 letters and not for one letter??? and by the way it is also problems for many Arabic colleges who is using Eclipse. i repeat Eclipse work perfect for 27 letters and has problem with just one which is "fa" , and by the way when i work in jsp and tomcat i don't have this problem since it is supported there. any help?
please, send us steps to reproduce the problem.
the "fa" letter is produced by typeing the "t" key in us 102 keyboard, right? I can input this letter in the javaeditor, texteditor, text, etc.
(In reply to comment #21) > the "fa" letter is produced by typeing the "t" key in us 102 keyboard, right? > I can input this letter in the javaeditor, texteditor, text, etc. Right the t letter, please understand me, I don't have any problem typing it inside the editor, the problem that when i print it in the console i got "?" this is also problem when you save it inside mysql table or if you want to compare 2 words which contains this letter then you will have problem because you have "?" instead of "fa". did you understand my problem?
Where did you set the font of the Console?
(In reply to comment #23) > Where did you set the font of the Console? Windows -> General-> Colors and fonts ->CVS -> Cvs console font
Try Windows > Preferences... > General > Colors and fonts Debug > Console font
(In reply to comment #25) > Try Windows > Preferences... > General > Colors and fonts Debug > Console font unfortunately the same, i can see that the font change in the console but the problem it is the same "?" instead of "fa". i beleive it is not font problem it is a big in the tool it self since many arabic programmer have the same problem.
I can reproduce the problem now. I selfhost Eclipse with -Dfile.encoding="UTF-8" and encoding=UTF-8 in the launch dialog (common tab). The unicode for the letter feh is U0641, when it gets to StyledText used by the TextConsoleViwer this char is replaced by UFFFD. I don't know why is that. As stated before, other arabic letters work fine. I'm moving this to the Debug component. If the TextConsoleViewer feds the right character to StyledText it work fine.
Created attachment 65723 [details] screen shot This is the output I get, which look reasonable. Please check. * set the console encoding on your launch config to UTF-8 (on the Common tab of your launch config) * add the VM arg to your config "-Dfile.encoding=UTF-8" (unless that is your OS default file encoding) * choose a font that can display the characters
Also note - I am using I20070502-0010
(In reply to comment #29) > Also note - I am using I20070502-0010 hello unfortunately same problem with letter "fa" i did what u asked me to do, adding "-Dfile.encoding=UTF-8" helps to not write this in each program!! this is a compy of my program, you might run it and see where is the problem. thnaks in advance. ------------------------------- import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.sql.SQLException; public class font { public static void main(String[] args) { PrintStream ps = null; String word_temp="ÇáÝÑÓÇä"; System.out.println(word_temp); } }
Can you provide screen shots of what it should look like, and what it does look like?
And please attach your example as attachement (best inside zip) as simply putting it into the comment can garble special characters.
Created attachment 65792 [details] program code and result I did look at screen shot, it is correct, it seems you don't have same problem, any way please look to my attached file. thanks
This works for me both on 3.2.2 and 3.3. Can you attach your source file (.java) in a zip? Just pasting the chars into bugzilla does not work for special characters.
Created attachment 65796 [details] font.java
Also works for me... have you tried a 3.3 build, such as today's I20070503-0842?
(In reply to comment #36) > Also works for me... have you tried a 3.3 build, such as today's > I20070503-0842? do you mean 3.3 verstion ? and excuse me what is I20070503-0842 ?
(In reply to comment #37) > (In reply to comment #36) > > Also works for me... have you tried a 3.3 build, such as today's > > I20070503-0842? > do you mean 3.3 verstion ? and excuse me what is I20070503-0842 ? i did download I20070503-0842, how to install inside my eclipse?
I'm not sure you can install it with "my Eclipse" - it may not be compatible... it would be better to try it standalone.
(In reply to comment #36) > Also works for me... have you tried a 3.3 build, such as today's > I20070503-0842? I did copy the feature and plugin directories inside my eclipse, but i still have same problem, could you please tell me which font you did use console.
Default console font - Courier New, Regular, size 10.
(In reply to comment #41) > Default console font - Courier New, Regular, size 10. i use the same but without any success !! where you think the problem is? i have these problem also in other computer. do you know where i can download Eclipse version 3.3 ?
I20070503-0842, is the latest Eclipse 3.3.
(In reply to comment #43) > I20070503-0842, is the latest Eclipse 3.3. Do you know from where i download it ?
http://download.eclipse.org/eclipse/downloads/ select JDT
(In reply to comment #45) > http://download.eclipse.org/eclipse/downloads/ > select JDT i did download it and unzip the file , but i couldn't see how to run Eclipse there no eclipse run icon. i will see this tomorrow. thnaks again for your help
Marking as works for me.
(In reply to comment #47) > Marking as works for me. Unfortunately it still not working for me, i did try different versions of Eclipse, also I did try many different PCs and it is not working yet, I am really cerious how it work for you since we have same setting. if you think it is working for you then you can close this bug, but by the way w as Arabic users still have this problem and not just me.
(In reply to comment #48) > ...as Arabic users still have this problem and not just me. Re-opening due to above comment. I wonder if the OS default locale is causing the difference.
In Linux, I changed my locale to Arabic (India), then ran Eclipse 3.3 M7. I used the attached font.java. The default encoding was UTF-8. The program runs fine and prints the output as expected. I will attach a screenshot.
Created attachment 66752 [details] Screenshot of successful run in Linux
see comment 27: "I selfhost Eclipse with -Dfile.encoding="UTF-8" and encoding=UTF-8 in the launch dialog (common tab)." In the selfthost Eclipse run this piece of code here: public class PR179753 { public static void main(String[] args) { String word_temp="\u0627\u0644\u0641\u0631\u0633\u0627\u0646"; try { word_temp = new String(word_temp.getBytes("UTF-8")); } catch (Exception e1) { e1.printStackTrace(); } System.out.println(word_temp); } } (see the screenshot in my machine, I'll add it in a sec)
Created attachment 66785 [details] screenshot
(In reply to comment #54) > Created an attachment (id=66785) [details] > screenshot hello Felipe Heidrich , is it mean that you still have the same problem as me ? if you don't have this problem any more could you please let me know what you did in order to solve it ?
Thanks for the more exact test case Felipe, I've got it happening in my workspace now. Now if I could only figure out why the console is being so difficult :)
Note: If you give the "-Dfile.encoding="UTF-8"" argument to the VM that you launch the test program with, it prints out correctly. You don't have to change the console encoding on the common-tab because the default is UTF-8 (that setting is picked up from the VM used to launch Eclipse).
(In reply to comment #57) > You don't have to > change the console encoding on the common-tab because the default is UTF-8 > (that setting is picked up from the VM used to launch Eclipse). You are running on Linux, right ? In windows the default for english is cp1252. Curtis, probably now you can verify that the letter feh U0641 is replaced by UFFFD, see my comment #27.
I had a chat with Daniel Megert and he helped me to understand the problem in this bug report. First, this report should be closed as WONTFIX. The error in here is how people run their code. IMO, The proper way to print out i18n text to the console is: 1. use \u escape in the string, e.g. String s="\u0627\u0644\u0641\u0631\u0633\u0627\u0646"; 2. Add -Dfile.encoding="UTF-8" to vm args Important: you need set this for every launching configuration you have! This setting is not inherit from a self-host eclipse to Java application run from within the self-host eclipse. Note: it doesn't need to be UTF-8, you can use any encoding you want as long as it support the text you are trying to print. I recommend Unicode. 3. In common tab, in the launch configuration, set the console encoding to UTF-8 (or whatever you used in step 2). Important: you need set this for every launching configuration you have! Notes: a) If you use System.out.println(string.getBytes("utf8" )); than you have set the encoding in steps 2 and 3 to UTF-8 b) to reproduce the problem the reporter has use System.out.println(string.getBytes("utf8" )); and set UTF-8 in step 3 but DO NOT set step 2. c) It would be easier to use if the value of console encoding was default to the value of file.encoding. That would make step 3 unnecessary.
Someone make a FAQ! This "bug" has been around forever and people keep hitting it.
If you write a FAQ for this also mention how to set the font: Preferences->General->Appearance->Colors and Fonts->Debug->Console Font Normally font substitution gets you by, but if you need to print out text from a very uncommon script or a rare CJK ideograph you will need to set a font that supports it.
(In reply to comment #59) > c) It would be easier to use if the value of console encoding was default to > the value of file.encoding. That would make step 3 unnecessary. Unfortunately there is no API to ask a system process for its encoding. Thus, the user has to set the encoding.
Created new feature request from Dani's suggestion - see bug 190520
(In reply to comment #59) > I had a chat with Daniel Megert and he helped me to understand the problem in > this bug report. > First, this report should be closed as WONTFIX. The error in here is how people > run their code. > IMO, The proper way to print out i18n text to the console is: > 1. use \u escape in the string, e.g. String > s="\u0627\u0644\u0641\u0631\u0633\u0627\u0646"; > 2. Add -Dfile.encoding="UTF-8" to vm args > Important: you need set this for every launching configuration you have! > This setting is not inherit from a self-host eclipse to Java application run > from within the self-host eclipse. > Note: it doesn't need to be UTF-8, you can use any encoding you want as long as > it support the text you are trying to print. I recommend Unicode. > 3. In common tab, in the launch configuration, set the console encoding to > UTF-8 (or whatever you used in step 2). > Important: you need set this for every launching configuration you have! > Notes: > a) If you use System.out.println(string.getBytes("utf8" )); than you have set > the encoding in steps 2 and 3 to UTF-8 > b) to reproduce the problem the reporter has use > System.out.println(string.getBytes("utf8" )); and set UTF-8 in step 3 but DO > NOT set step 2. > c) It would be easier to use if the value of console encoding was default to > the value of file.encoding. That would make step 3 unnecessary. First of all what you suggest it doesn’t solve the problem and even as Arabic users we can’t use \u escape , as we load millions of Arabic words from thousands of text files. I did use all waht you mention even before but unfortunately Eclipse still have problem with only one letter in Arabic which is "fa" . I hope people in Eclipse understand our problems as Arabic users. you should hear us and not native English speakers which they don’t have any problems regarding encoding. my last question now : is there any way to print Arabic text without any problem in Eclipse ??
>is there any way to print Arabic text without any problem in Eclipse ?? Yes: 1. go to the launch configuration of the program you launch 2. switch to the 'Arguments' tab 3. add -Dfile.encoding=UTF-8 into the VM arguments field 4. switch to 'Common' tab 5. set console encoding to UTF-8 With this I can launch the example file (which is UTF-8 encoded) and it writes the correct string three times to the console when launched (see attached picture).
Created attachment 69925 [details] Shows the correct output
Created attachment 69941 [details] 1
Created attachment 69942 [details] 2
Created attachment 69943 [details] 3
(In reply to comment #65) > >is there any way to print Arabic text without any problem in Eclipse ?? > Yes: > 1. go to the launch configuration of the program you launch > 2. switch to the 'Arguments' tab > 3. add -Dfile.encoding=UTF-8 into the VM arguments field > 4. switch to 'Common' tab > 5. set console encoding to UTF-8 > With this I can launch the example file (which is UTF-8 encoded) and it writes > the correct string three times to the console when launched (see attached > picture). I did try what you suggest again. Unfortunately i still have the same problem (Please see the attached files). I have Eclipse SDK 3.2.2 , I have an English windows XP , I did try this program on many other PCs with the same problem , at least we are 3 people who still have this problem. Since it work on your PC it might some thing else which cause this problem. Any idea ? Faraj
Make sure that you use UTF-8 in the code and not utf8.Also note that you don't print word_temp1 but two times word_temp. No idea though why the last string isn't printed correctly on your machine. It works fine on my machine. Can you try with a different JRE? Also, is BIDI support installed on your machine? It is on mine (since I installed some Arabic languages).
Also: launch it a second time and check whether it works with the second run. I just found something completely strange: when I launch the very first time I get: ??????? ??????? ??????? But in further runs it is OK. Looks like the encoding isn't properly set to the Console the first time. I'll try to find a simple test case and log a bug.
(In reply to comment #72) > Also: launch it a second time and check whether it works with the second run. I > just found something completely strange: when I launch the very first time I > get: > ??????? > ??????? > ??????? > But in further runs it is OK. Looks like the encoding isn't properly set to the > Console the first time. I'll try to find a simple test case and log a bug. hi thanks for your reply! Although of my all trys unfortunately I still have the same problem. The problem just in console , when I try JOptionPane.showMessageDialog(null,word_temp); it works fine for all. I did trye java 1 and java 5 with same problem. regards
>Looks like the encoding isn't properly set to the >Console the first time. I'll try to find a simple test case and log a bug. This was probably a bug in my target workspace. Cannot reproduce this in a fresh workspace running 3.3 RC3. Please also download 3.3 RC3 and try with that one. Simply unzip it into a new location and then start with a fresh workspace. Then add the test file and launch it as indicated in comment 65.
(In reply to comment #74) > >Looks like the encoding isn't properly set to the > >Console the first time. I'll try to find a simple test case and log a bug. > This was probably a bug in my target workspace. Cannot reproduce this in a > fresh workspace running 3.3 RC3. > Please also download 3.3 RC3 and try with that one. Simply unzip it into a new > location and then start with a fresh workspace. Then add the test file and > launch it as indicated in comment 65. Dear Daniel Megert , I did download 3.3 RC3 . :) :) it works perfect from first try. I am really happy since I can continue using Eclipse on my PhD research. it is very powerfull tool. I had that problem before but now every things is perfect. Thnaks to all who help to solve this problem and special thanks for Daniel Megert . best regards :)