Bug 499600 - Mono won't start with paths that contains non-ASCII character and MS .Net Fx is not installed
Summary: Mono won't start with paths that contains non-ASCII character and MS .Net Fx ...
Status: RESOLVED DUPLICATE of bug 464128
Alias: None
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: SVN
Hardware: PC Windows
: P5 - None : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-30 02:02 UTC by Joe Hu
Modified: 2010-11-20 01:58 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Purposed patch (614 bytes, patch)
2009-04-30 02:02 UTC, Joe Hu
Details | Diff
Patch for 2.4 (844 bytes, patch)
2009-04-30 07:50 UTC, Joe Hu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Hu 2009-04-30 02:02:53 UTC
Created attachment 289079 [details]
Purposed patch

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; zh-CN; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9 GTB5 (.NET CLR 3.5.30729)

This problem will occur if all of the following conditions are met:
1. The GAC path or application path contains non-ASCII character(e.g. Chinese characters)
2. MS .Net Framework is not installed in the system.

Mono will report cannot load mscorlib or cannot load assembly in the case. 

Reproducible: Always

Steps to Reproduce:
1. Ensure .Net Fx is not installed.
2. Put mono and the application into a folder which name contains non-ASCII character (I have only tested Chinese characters, but I an sure that the same applies to other Asia languages).
3. Start the application using mono.
Actual Results:  
The application won't start.

Expected Results:  
The application should start.

After my investigation, this problem is caused by encoding of the path. fopen in msvcrt.dll (which is used in win32 for opening assembly if .Net Fx is not present in the system) accept the path in system encoding, but mono internally uses UTF-8 and passes UTF-8 path to fopen.

I have fixed this problem in the 2.4 tarball, tested on some machines and it worked very well. But I have found that in SVN head the fopen call moved to mono-filemap.c, so I made a new patch of that. Note that it is migrated from my 2.4 patch, although I don't have time to test it, it shouldn't have any problem.
Comment 1 Joe Hu 2009-04-30 07:50:23 UTC
Created attachment 289146 [details]
Patch for 2.4
Comment 2 Jonathan Chambers 2010-11-20 01:58:55 UTC
Duplicate of 464128.

*** This bug has been marked as a duplicate of bug 464128 ***