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

Bug 343354

Summary: DBCS4.1: CDT Debugger cannot start if the project name has DBCS characters in Mac OS X.
Product: [Tools] CDT Reporter: Harendra <harendra>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: camle, cdtdoug, kennoji, kitlo, pawel.1.piech, vivkong
Version: 8.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Debugger startup failure screenshot
none
Test project
none
Encode commands in UTF-8 as fallback none

Description Harendra CLA 2011-04-20 04:23:41 EDT
Build Identifier: I20110412-2200

CDT Version:I201103111317
Java Version:1.6.0_24-b07-334
OS: Mac OS X
Locale: ja_JP.utf8
This is Mac specific problem, working in windows and linux.

Reproducible: Always

Steps to Reproduce:
1. Create a new C++ project with DBCS name. Alternatively import the attached project.
2. Create a new C++ source file, build and run.
3. Click on project , right click->Debug as->Local c/c++ application.
4. The debugger wont start. It shows error as shown in the screenshot.
Comment 1 Harendra CLA 2011-04-20 04:27:19 EDT
Created attachment 193664 [details]
Debugger startup failure screenshot
Comment 2 Harendra CLA 2011-04-20 04:27:47 EDT
Created attachment 193665 [details]
Test project
Comment 3 Marc-André Laperle CLA 2011-04-24 03:52:35 EDT
Created attachment 193961 [details]
Encode commands in UTF-8 as fallback

The problem seems to be that the string cannot be encoded in the default charset which is MacRoman (at least for me).

Looking at the String.getBytes domcumentation:
"The behavior of this method when this string cannot be encoded in the default charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required."

I tried to encode the -environment-cd command in UTF-8 as a fallback when it's not possible to encode the command in the default charset and it works, the debug session can start. But other things don't work: the runner.cpp file won't open because the path is wrong, the gdb console will also show wrong paths. There must be a more general way to address this problem.