Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 525966

Summary: Console reads Trash Character
Product: [Eclipse Project] Platform Reporter: Narae Oh <brwings02>
Component: DebugAssignee: Paul Pazderski <paul-eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, paul-eclipse, sarika.sinha
Version: 4.8   
Target Milestone: 4.13 M1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 548356    
Bug Blocks: 549366, 552030    
Attachments:
Description Flags
it is result
none
wanted result
none
Windows Hangul Keymap none

Description Narae Oh CLA 2017-10-12 22:57:42 EDT
I used Java Project.
Here is a simple example.
===========================
import java.util.Scanner;

public class ScanTest {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true)
		{
		  System.out.println("name : ");
		  String name = sc.nextLine();
		  System.out.println("phone number : ");
		  String phone = sc.nextLine();
		  System.out.println("name : " + name + ", phone number: " + phone);
	        }
	}
}
==========================
If I write English or Number, it work well. 
but If I start to Korean (about Other Language, I don't know), it work not well.

I have to move the cursor whenever I input Korean on console.
If not, cursor not moved And Input Value pluses Trash value. 

if it excute on real consol(cmd) or other tool, it work well.

you must input korean(or other language) using keyboard. 
if you use capy&paste, you can't see this problem.
Comment 1 Narae Oh CLA 2017-10-12 23:00:01 EDT
Created attachment 270963 [details]
it is result
Comment 2 Narae Oh CLA 2017-10-12 23:15:15 EDT
Created attachment 270964 [details]
wanted result

all of two cases(result and wanted result) used same input data
"wanted result" case moved cursor to end, before typing korean.
Comment 3 Dani Megert CLA 2017-10-16 08:13:52 EDT
This looks like the wrong encoding is specified when launching (or when creating the project). An encoding that does not support Korean.
Comment 4 Narae Oh CLA 2017-10-16 23:21:24 EDT
I was setting like next
=============================
[Window > Preference > General > Workspace > Text file encoding]'s value is UTF-8
[Window > Preference > General > Content Types > Text(and Java Class File) > Default encoding]'s value is UTF-8
[Window > Preference > General > Editors > Text Editors > Spelling > Encoding]is UTF-8
==============================
After that I made JavaProject. 
And [Properties > Resource > Text file encoding]'s value in that Project is also UTF-8
And source page is UTF-8 ([Edit > Set Endcoding] shows that)

but same problem occured.
Comment 5 Dani Megert CLA 2017-12-14 11:37:41 EST
(In reply to Narae Oh from comment #4)
> I was setting like next
> =============================
> [Window > Preference > General > Workspace > Text file encoding]'s value is
> UTF-8
> [Window > Preference > General > Content Types > Text(and Java Class File) >
> Default encoding]'s value is UTF-8
> [Window > Preference > General > Editors > Text Editors > Spelling >
> Encoding]is UTF-8
> ==============================
> After that I made JavaProject. 
> And [Properties > Resource > Text file encoding]'s value in that Project is
> also UTF-8
> And source page is UTF-8 ([Edit > Set Endcoding] shows that)
> 
> but same problem occured.

Those have all nothing to do with the encoding used when launching. Take a look at the 'Common' tab in your launch configuration.

If that does not help, the easiest is to attach a demo workspace.
Comment 6 Paul Pazderski CLA 2019-06-17 15:53:18 EDT
Created attachment 278975 [details]
Windows Hangul Keymap

I may have fixed this bug by accident as part of bug 548356.

For others not familiar with typing Korean (like me) here is how I reproduced this bug using Windows 7 (should be the same for Windows 10):
 - add Korean keyboard layout and also enable Microsoft-IME below
 - enable Korean layout for eclipse (Windows can manage layouts per application) and ensure IME is enabled and click the Han/Eng Toggle so that Han(gul) mode is enabled (see attachment)

On Ubuntu Mate 18.10 I managed to configure Korean input according to https://askubuntu.com/a/451008
 - install package 'ibus-hangul'
 - run 
        $ im-config -n ibus
     or without arguments and select ibus in GUI
 - restart your X-session
 - now either enable Hangul/Korean in IBUS-settings GUI (ibus-setup) or run 
        $ ibus engine hangul
     to temporary enable hangul
 - now you can swap between English/Hangul input with Shift+Space (default hotkey)
(Those are my first experience with non latine input methods on Linux. If someone had a better/shorter explanation feel free to add it)

To reproduce Narae Oh's example set your keyboard layout to Dubeolsik (apparently the most common and often default layout; named '2 Beolsik' on Windows and this is already done if you followed the steps above) and then on your English (or German) labeled keyboard type "rla cjf tn" (without spaces)  for the first name and "sk dud gml" for the second name.
Comment 7 Paul Pazderski CLA 2019-07-10 11:37:44 EDT
Fixed in bug 548356 and verified with I20190709-1800.