Bug 10669 - mandroid doesn't work if %CD% contains non-ASCII characters
Summary: mandroid doesn't work if %CD% contains non-ASCII characters
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.6.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
: 9898 ()
Depends on:
Reported: 2013-02-25 21:57 UTC by Jonathan Pryor
Modified: 2013-03-14 14:11 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:





Related Links:

Description Jonathan Pryor 2013-02-25 21:57:08 UTC
(Summary is close but not entirely correct.)

Mandroid doesn't work when:

1. The system Language for non-Unicode programs is a non-ASCII locale.
2. %CD% (the current working directory) contains non-ASCII characters.

This prevents `mandroid` from building on non-English systems.

For example:

1. Open the Control Panel.
1.a: Win8: Desktop > Win+C > Settings > Control Panel
2. Search for Region
3. Open the Region control panel applet.
4. Click the Administrative tab.
5. In the Language for non-Unicode programs section, click the Change system locale... button.
6. Set the Current system locale to e.g. Russian (Russia).
7. Click OK, then Restart now.
8. Log back in, then create a directory named "Джон" (no quotes)
8.a. In case that's unreadable, it's just contains some russian, non-ASCII, characters. Hit translate.google.com, enter ~anything, and repeat until you find an acceptable word. ;-)
9. Open CMD.EXE, then `cd` to the directory created in (8).
10. Run:

> "C:\Program Files (x86)\MSBuild\Xamarin\Android\mandroid.exe" --version > %TMP%\o.txt 2> %TMP%\e.txt
> notepad %TMP%\o.txt

Expected results: o.txt will contain e.g. "mandroid Trial".

Actual results: o.txt will contain:

Cannot determine the text encoding for the assembly location: C:\Users\Jonathan\Джон\mandroid-win.exe
Please add the correct encoding to MONO_EXTERNAL_ENCODINGS and try again.

(The directory name will vary depending on where you ran it from.)

Workaround: Change the Language for non-Unicode programs (§6, above) to English.

This has the side effect of making the previous %CD% "C:\Users\Jonathan\????", which is valid ASCII, and things work.

(I'm quite sure this is a horrible horrible workaround.)
Comment 3 Jonathan Pryor 2013-02-26 17:34:03 UTC
Should be fixed in master/db55d435, to land in 4.6.1.
Comment 4 Jonathan Pryor 2013-03-14 14:11:20 UTC
*** Bug 9898 has been marked as a duplicate of this bug. ***