Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343354 - DBCS4.1: CDT Debugger cannot start if the project name has DBCS characters in Mac OS X.
Summary: DBCS4.1: CDT Debugger cannot start if the project name has DBCS characters in...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.0   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-20 04:23 EDT by Harendra CLA
Modified: 2020-09-04 15:23 EDT (History)
6 users (show)

See Also:


Attachments
Debugger startup failure screenshot (254.61 KB, image/png)
2011-04-20 04:27 EDT, Harendra CLA
no flags Details
Test project (82.79 KB, application/zip)
2011-04-20 04:27 EDT, Harendra CLA
no flags Details
Encode commands in UTF-8 as fallback (2.17 KB, patch)
2011-04-24 03:52 EDT, Marc-André Laperle CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.