xcodebuild doesn't accept UTF-8-MAC -encoded arguments

Originator:ali.rantakari
Number:rdar://16119172 Date Originated:20-Feb-2014
Status:Open Resolved:
Product:Xcode Product Version:5.0.2 (5A3005)
Classification:Other bug Reproducible:Always
 
Summary:
xcodebuild expects its arguments to be encoded as UTF-8 (composed form), and does not accept arguments encoded as UTF-8-MAC (decomposed form).

NSTask encodes its arguments by invoking -[NSString fileSystemRepresentation], which encodes using UTF-8-MAC (decomposed form), which makes it extremely difficult to successfully invoke xcodebuild via NSTask when some arguments contain non-ASCII code points.

Steps to Reproduce:
1. Install Xcode
2. Create a new Xcode project called "EncodingBugTest"
3. Rename the main app target to "Ä" (that is the A-umlaut)
4. Open Terminal
5. Ensure that Terminal is using the "Unicode (UTF-8)" character encoding: (Preferences > Settings > (Selected profile) > Advanced > Character encoding)
6. Use the `cd` command to change the Terminal working directory to the one where you saved the Xcode project
7. Run: xcodebuild -project EncodingBugTest.xcodeproj -target $(iconv -f UTF-8 -t UTF-8-MAC /dev/stdin <<< "Ä")

Expected Results:
Expected xcodebuild to successfully build the project target.

Actual Results:
Instead we see the following:

xcodebuild: error: The project 'EncodingBugTest.xcodeproj' does not contain a target named 'Ä'.

Version:
Xcode Version 5.0.2 (5A3005)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!